-
-
Notifications
You must be signed in to change notification settings - Fork 526
Introduce suspenders:rake
generator
#1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
stevepolitodesign
merged 1 commit into
suspenders-3-0-0
from
suspenders-3-0-0-rake-generator
Dec 12, 2023
Merged
Introduce suspenders:rake
generator
#1144
stevepolitodesign
merged 1 commit into
suspenders-3-0-0
from
suspenders-3-0-0-rake-generator
Dec 12, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87032f1
to
cece45a
Compare
4 tasks
I think we're running into a flexibility issue. What if we made a default rake task that looks for whether bundler-audit is installed and run it if so, ignore it otherwise? I have no idea whether that's possible, but it would allow for the kind of extensibility we need. in lib/suspenders/tasks.rb task :suspenders do
if Bundler.rubygems.find_name("bundle-audit").any?
Rake::Task[:"bundle:audit"].run
end
if Bundler.rubygems.find_name("standard").any?
Rake::Task[:standard].run
end
end generated Rakefile require 'suspenders/tasks'
default: [:suspenders] |
stevepolitodesign
added a commit
that referenced
this pull request
Nov 28, 2023
The [original implementation][] was written in 2014, and is no longer relevant. This is because the gem ships [with a Rake task][] that can be set as the default task, which will be addressed in #1144 [original implementation]: e23157e [with a Rake task]: https://github.com/rubysec/bundler-audit#rake-tasks
stevepolitodesign
added a commit
that referenced
this pull request
Nov 28, 2023
Uses the [bundler-audit][] gem to update the local security database and show any relevant issues with the app's dependencies. This generator is only responsible for installing the gem. The [original implementation][] was written in 2014, and is no longer relevant. This is because the gem ships [with a Rake task][] that can be set as the default task, which will be addressed in #1144 Also exposes `backup_file` and `restore_file` test helpers into the public API. [bundler-audit]: https://github.com/rubysec/bundler-audit [original implementation]: e23157e [with a Rake task]: https://github.com/rubysec/bundler-audit#rake-tasks
stevepolitodesign
added a commit
that referenced
this pull request
Nov 28, 2023
Uses the [bundler-audit][] gem to update the local security database and show any relevant issues with the app's dependencies. This generator is only responsible for installing the gem. The [original implementation][] was written in 2014, and is no longer relevant. This is because the gem ships [with a Rake task][] that can be set as the default task, which will be addressed in #1144 Also exposes `backup_file` and `restore_file` test helpers into the public API. [bundler-audit]: https://github.com/rubysec/bundler-audit [original implementation]: e23157e [with a Rake task]: https://github.com/rubysec/bundler-audit#rake-tasks
stevepolitodesign
added a commit
that referenced
this pull request
Nov 28, 2023
Uses the [bundler-audit][] gem to update the local security database and show any relevant issues with the app's dependencies. This generator is only responsible for installing the gem and adding the Rake task. The [original implementation][] was written in 2014, and is no longer relevant. This is because the gem ships [with a Rake task][] that can be set as the default task, which will be addressed in #1144 Also exposes `backup_file` and `restore_file` test helpers into the public API. [bundler-audit]: https://github.com/rubysec/bundler-audit [original implementation]: e23157e [with a Rake task]: https://github.com/rubysec/bundler-audit#rake-tasks
stevepolitodesign
added a commit
that referenced
this pull request
Nov 28, 2023
Uses the [bundler-audit][] gem to update the local security database and show any relevant issues with the app's dependencies. This generator is only responsible for installing the gem and adding the Rake task. The [original implementation][] was written in 2014, and is no longer relevant. This is because the gem ships [with a Rake task][] that can be set as the default task, which will be addressed in #1144 Also exposes `backup_file` and `restore_file` test helpers into the public API. [bundler-audit]: https://github.com/rubysec/bundler-audit [original implementation]: e23157e [with a Rake task]: https://github.com/rubysec/bundler-audit#rake-tasks
crackofdusk
reviewed
Dec 11, 2023
cece45a
to
34fb28a
Compare
34fb28a
to
83ba7fd
Compare
Add necessary files to make the [plugin][] an [engine][], which automatically loads Rake tasks located in `lib/tasks`. This means when the `suspenders` gem is installed, the consumer can run `bundle exec rake suspenders:rake`, and any future tasks. Because `suspenders:lint` and `suspenders:advisories` may not necessarily have been invoked, we need to check if those gems are installed. [plugin]: https://guides.rubyonrails.org/plugins.html [engine]: https://guides.rubyonrails.org/engines.html Co-authored-by: Mike Burns <mburns@thoughtbot.com>
crackofdusk
reviewed
Dec 12, 2023
crackofdusk
reviewed
Dec 12, 2023
83ba7fd
to
6251e9f
Compare
stevepolitodesign
added a commit
that referenced
this pull request
May 10, 2024
Uses the [bundler-audit][] gem to update the local security database and show any relevant issues with the app's dependencies. This generator is only responsible for installing the gem and adding the Rake task. The [original implementation][] was written in 2014, and is no longer relevant. This is because the gem ships [with a Rake task][] that can be set as the default task, which will be addressed in #1144 Also exposes `backup_file` and `restore_file` test helpers into the public API. [bundler-audit]: https://github.com/rubysec/bundler-audit [original implementation]: e23157e [with a Rake task]: https://github.com/rubysec/bundler-audit#rake-tasks
stevepolitodesign
added a commit
that referenced
this pull request
May 10, 2024
Add necessary files to make the [plugin][] an [engine][], which automatically loads Rake tasks located in `lib/tasks`. This means when the `suspenders` gem is installed, the consumer can run `bundle exec rake suspenders:rake`, and any future tasks. Because `suspenders:lint` and `suspenders:advisories` may not necessarily have been invoked, we need to check if those gems are installed. [plugin]: https://guides.rubyonrails.org/plugins.html [engine]: https://guides.rubyonrails.org/engines.html Co-authored-by: Mike Burns <mburns@thoughtbot.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add necessary files to make the plugin an engine, which
automatically loads Rake tasks located in
lib/tasks
. This means whenthe
suspenders
gem is installed, the consumer can runbundle exec rake suspenders:rake
, and any future tasks.Because
suspenders:lint
andsuspenders:advisories
may notnecessarily have been invoked, we need to check if those gems are
installed.
How to review this pull request
Spin up a new Rails application.
Scaffold a domain in order to generate passing tests.
Install suspenders on this branch.
Run the following generators.
Run Rake and note the output. It should run the test suite, run
standard
and run
bundler-audit
.bundle exec rake
Co-authored-by: Mike Burns mburns@thoughtbot.com