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

Add RUBY_VERSION feature + pin json_pure/rspec-rubocop #200

Merged
merged 6 commits into from
Jul 29, 2016

Conversation

bastelfreak
Copy link
Member

@bastelfreak bastelfreak commented Jul 29, 2016

this will implement #198

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'] %>
Copy link
Member

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.

Copy link
Contributor

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?

Copy link
Member Author

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 -%>
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

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

@igalic igalic merged commit d65a898 into voxpupuli:master Jul 29, 2016
@bastelfreak bastelfreak deleted the testplatform branch July 29, 2016 14:30
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.

3 participants