-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Introduce suspenders:accessibility
generator
#1137
Merged
Merged
Conversation
This file contains 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
stevepolitodesign
changed the title
Introduce
Introduce Oct 31, 2023
suspenders:accessibility_generator
suspenders:accessibility
generator`
stevepolitodesign
changed the title
Introduce
Introduce Oct 31, 2023
suspenders:accessibility
generator`suspenders:accessibility
generator
This comment was marked as resolved.
This comment was marked as resolved.
stevepolitodesign
force-pushed
the
accessibility-generator
branch
from
November 3, 2023 09:55
e963ee1
to
c76af07
Compare
stevepolitodesign
force-pushed
the
accessibility-generator
branch
2 times, most recently
from
November 3, 2023 12:09
c4c8ccc
to
8a59f7f
Compare
Comment on lines
+14
to
+20
included do | ||
def raise_if_api_only_app | ||
if api_only_app? | ||
raise Suspenders::Generators::APIAppUnsupported::Error | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will run first when we call include Suspenders::Generators::APIAppUnsupported
in a generator. This is important because we don't want to invoke any of the generator's methods.
seanpdoyle
reviewed
Nov 3, 2023
seanpdoyle
approved these changes
Nov 3, 2023
Ported over from #1105 Installs [capybara_accessibility_audit] and [capybara_accessible_selectors]. `./bin/rails g suspenders:accessibility` Introduces `Suspenders::Generators::APIAppUnsupported` module for generators that cannot be run in an [API only][] application. This uses a [concern][] to ensure we raise an error before the generator including the module invokes any of its methods. [capybara_accessibility_audit]: https://github.com/thoughtbot/capybara_accessibility_audit [capybara_accessible_selectors]: https://github.com/citizensadvice/capybara_accessible_selectors [API only]: https://guides.rubyonrails.org/api_app.html [concern]: https://api.rubyonrails.org/classes/ActiveSupport/Concern.html
stevepolitodesign
force-pushed
the
accessibility-generator
branch
from
November 3, 2023 19:35
8a59f7f
to
23f54d8
Compare
stevepolitodesign
added a commit
that referenced
this pull request
May 10, 2024
Ported over from #1105 Installs [capybara_accessibility_audit] and [capybara_accessible_selectors]. `./bin/rails g suspenders:accessibility` Introduces `Suspenders::Generators::APIAppUnsupported` module for generators that cannot be run in an [API only][] application. This uses a [concern][] to ensure we raise an error before the generator including the module invokes any of its methods. [capybara_accessibility_audit]: https://github.com/thoughtbot/capybara_accessibility_audit [capybara_accessible_selectors]: https://github.com/citizensadvice/capybara_accessible_selectors [API only]: https://guides.rubyonrails.org/api_app.html [concern]: https://api.rubyonrails.org/classes/ActiveSupport/Concern.html
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.
Introduce
suspenders:accessibility
generatorPorted over from #1105
Installs capybara_accessibility_audit and
capybara_accessible_selectors.
./bin/rails g suspenders:accessibility
Introduces
Suspenders::Generators::APIAppUnsupported
module forgenerators that cannot be run in an API only application.
This uses a concern to ensure we raise an error before the generator
including the module invokes any of its methods.
How to manually review this pull-request
If you want to manually run this generator, simply do the following:
cd test/dummy
touch Gemfile
./bin/rails g suspenders:accessibility
Confirm the
Gemfile
andGemfile.lock
contains the gems.To test that it won't work on an API only application, comment out or remove
config.api_only = true
fromtest/dummy/config/application.rb
and run thesteps above