-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Rake notes compatibility in Rails 5.1.0 #1661
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,12 @@ module RSpec | |
module Rails | ||
# Railtie to hook into Rails. | ||
class Railtie < ::Rails::Railtie | ||
|
||
# As of Rails 5.1.0 you can register directories to work with `rake notes` | ||
if Gem::Requirement.new(">= 5.1.0").satisfied_by?(Gem::Version.new(::Rails.version)) | ||
SourceAnnotationExtractor::Annotation.register_directories("spec") | ||
end | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The build is breaking due to the whitespace inserted here, our convention is to not allow trailing whitespace in files, would you mind cleaning it up? |
||
# Rails-3.0.1 requires config.app_generators instead of 3.0.0's config.generators | ||
generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators | ||
generators.integration_tool :rspec | ||
|
@@ -67,6 +73,7 @@ def supports_action_mailer_previews?(config) | |
# always return `true`. | ||
config.respond_to?(:action_mailer) && ::Rails::VERSION::STRING > '4.1' | ||
end | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you remind removing this? Adding extra spacing to existing code tends to cause git churn which we would like to avoid. |
||
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.
Could you switch this away from using rubygems please? It's generally a good idea to not assume it's present, a check on the rails version string is sufficient normally (e.g. ::Rails.version >= "5.1.0").
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.
You can see our preferred form a few lines down in fact, so making this
::Rails::VERSION::STRING >= '5.1'
would be preferred :)