Skip to content
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

Allow "ruby file:" syntax in gemfile #247

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

swelther
Copy link

Given in the gemfile the following ruby syntax is used:

ruby file: "../.ruby-version"

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'
…

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:

-ruby file: ".ruby-version"
+ruby {:file=>".ruby-version"}

Not sure if this is a big issue. Could be probably ignored because it still works and is just some minor visual thing.

@swelther swelther force-pushed the fix/allow-ruby-file-syntax-in-gemfile branch from b967a15 to dbcd772 Compare November 14, 2024 11:03
@swelther
Copy link
Author

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 :)

@swelther
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant