-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add RUBY_VERSION feature + pin json_pure/rspec-rubocop #200
Conversation
we recently did a release, we don't need to pull it from git anymore.
now we can set RUBY_VERSION and the needed operator. We're very smart in naming things so the two new options are: ruby-operator and ruby-version. We need that to pin certain gems only on certain damn legacy platforms
@@ -42,7 +44,7 @@ group <%= group %> do | |||
gem 'beaker-rspec', :require => false | |||
end | |||
<% else -%> | |||
gem '<%= gem['gem'] %>'<%= ", '#{gem['version']}'" if gem['version'] %>, <%= ' ' * (maxlen - gem['length']) %> :require => false<%= ", :git => '#{gem['git']}'" if gem['git'] %><%= ", :branch => '#{gem['branch']}'" if gem['branch'] %><%= ", :platforms => #{gem['platforms']}" if gem['platforms'] %> | |||
gem '<%= gem['gem'] %>'<%= ", '#{gem['version']}'" if gem['version'] %>, <%= ' ' * (maxlen - gem['length']) %> :require => false<%= ", :git => '#{gem['git']}'" if gem['git'] %><%= ", :branch => '#{gem['branch']}'" if gem['branch'] %><%= ", :platforms => #{gem['platforms']}" if gem['platforms'] %><%= " if RUBY_VERSION #{gem['ruby-operator']} #{gem['ruby-version']}" if gem['ruby-operator'] && gem['ruby-version'] %> |
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.
As there's a few if's on this line, perhaps the last one's conditions could be wrapped in parens to make it stand out more from the string to the left side.
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.
why don't we make this a helper function or two?
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.
+1. but please in a different PR.
<% 'branch' => gem['branch'], -%> | ||
<% 'ruby-version' => gem['ruby-version'], -%> | ||
<% 'ruby-operator' => gem['ruby-operator'], -%> | ||
<% 'length' => gem['gem'].length + (("', '".length if gem['version']) || 0) + gem['version'].to_s.length -%> |
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.
what's going on here?
(also, monads would be pretty sweet now…)
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.
we make dark black magic to determine the indentation in the 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.
that's what i'm saying we should have a function for
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.
I created #201 for this
cc87a06
to
c3d7db4
Compare
this will implement #198