-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fix support for ruby file: …
Gemfile syntax
#219
Conversation
Hey @nickcharlton, maybe you can take a look at this one? I copied the style of the acceptance test, so I'm not sure what do do about the hound bot comments 🤔 I opted to preserve the generated output when Locally the tests are all green as discussed in #218, using Bundler 2.3.27 via:
|
Great, thanks for doing this! I tested it out locally, and it's working for me with Bundler 2.3.27. I just deleted the Hound comments — I've been bit by bit moving to standard and this is on my list to do that here too. As it's copying existing styles anyway, I think it's fine. |
Previously, this would yield an error: appraise "foo" do ruby file: '../.ruby-version' gem "faraday-follow_redirects", "0.3.0" end `Appraisal::BundlerDSL#ruby_version` is emitting a block when the Gemfile DSL ruby method is used. Currently, this is emitted, which is not a method argument but rather a block: ruby {:file=>"../.ruby-version"} To fix this, we need to add `()` to ensure the arguments stay arguments: ruby({:file=>"../.ruby-version"}) This has been tested on Bundler 2.3.27 only — at this point in time we have compatibility issues with others. thoughtbot#218
e857380
to
9208c17
Compare
ruby({:file=>".ruby-version"}) | ||
|
||
gem "appraisal", :path => #{PROJECT_ROOT.inspect} | ||
Gemfile |
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.
Naming/HeredocDelimiterCase: Use uppercase heredoc delimiters.
run 'bundle install --local' | ||
run 'appraisal generate' | ||
|
||
expect(content_of 'gemfiles/ruby_version.gemfile').to eq <<-Gemfile.strip_heredoc |
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.
Style/NestedParenthesizedCalls: Add parentheses to nested method call content_of 'gemfiles/ruby_version.gemfile'.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [85/80]
Appraisals | ||
|
||
run 'bundle install --local' | ||
run 'appraisal generate' |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
end | ||
Appraisals | ||
|
||
run 'bundle install --local' |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
appraise 'ruby-version' do | ||
ruby file: ".ruby-version" | ||
end | ||
Appraisals |
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.
Naming/HeredocDelimiterCase: Use uppercase heredoc delimiters.
ruby RUBY_VERSION | ||
|
||
gem 'appraisal', :path => #{PROJECT_ROOT.inspect} | ||
Gemfile |
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.
Naming/HeredocDelimiterCase: Use uppercase heredoc delimiters.
I was looking for a way to use
ruby file: '.ruby-version'
in my gem for testing. Using thisAppraisals
file current yields an error:After digging around a little, I noticed that
Appraisal::BundlerDSL#ruby_version
is emitting a block when the Gemfile DSLruby
method is used. Currently, this is emitted – notice that this is not a method argument, but a block 🐛:So instead, we have to add
()
to ensure the arguments stay arguments:PS: I would like to add specs, but I'm unable to run specs (see #218).