-
-
Notifications
You must be signed in to change notification settings - Fork 110
Allow "ruby file:" syntax in gemfile #247
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
base: main
Are you sure you want to change the base?
Allow "ruby file:" syntax in gemfile #247
Conversation
b967a15
to
dbcd772
Compare
Hm seems I opened the PR too fast, in a real example the ruby line is omitted. Need to check why or if only my integration is somehow wrong :) |
I didn't find the already existing spec for this feature, adapted the code to work now. Just wondering why the test does not fail. |
Hello, |
This allows the use of the `ruby file:` syntax in Gemfiles, e.g.: ```ruby ruby file: "../.ruby-version" … ``` Previously, Appraisal would fail with `wrong number of arguments (given 0, expected 1) (ArgumentError)` ``` …/appraisal-2.5.0/lib/appraisal/bundler_dsl.rb:66:in `ruby': wrong number of arguments (given 0, expected 1) (ArgumentError) from …/appraisal-2.5.0/lib/appraisal/gemfile.rb:27:in `run' from …/appraisal-2.5.0/lib/appraisal/gemfile.rb:19:in `instance_eval' from …/appraisal-2.5.0/lib/appraisal/gemfile.rb:19:in `run' from …/appraisal-2.5.0/lib/appraisal/gemfile.rb:25:in `block in dup' … ```
1e2555e
to
d2f797a
Compare
I just rebased to get the tests to run, but the output is a bit unfortunate. To maintain support for older Ruby versions, it might have to stay. Unless anyone can think of another approach? |
hm looks like the syntax is different depending on the Ruby version. Should I update the spec to make it pass with every version or is this a no-go? |
Ah yeah, interesting. I think we might just need a different approach. I still can't think of a nicer way to do it, but we could write out a string with the value? |
Yeah sure, that could work :) I'll make some changes tomorrow 🤞 |
Just pushed a version that could work. Not sure about the solution, I basically reimplement the What do you think? |
At least the test is now green :) Except for "jruby-head", wondering what is happening there 🤔 But spec/acceptance/bundle_without_spec.rb:6 is failing, but the reason does not seem to be my changes, when I comment them out it still fails locally. Any idea what do to about that one? |
Given in the gemfile the following ruby syntax is used:
Appraisal would fail with
wrong number of arguments (given 0, expected 1) (ArgumentError)
This PR fixes this issue by allowing keyword arguments.
There is just one "visual" downsize that the syntax in the appraisal gemfiles is converted to Ruby 1.8 syntax:
Not sure if this is a big issue. Could be probably ignored because it still works and is just some minor visual thing.