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

TargetRubyVersion takes precedence over .ruby-version #3261

Merged
merged 1 commit into from
Jun 29, 2016
Merged

TargetRubyVersion takes precedence over .ruby-version #3261

merged 1 commit into from
Jun 29, 2016

Conversation

tjwp
Copy link
Contributor

@tjwp tjwp commented Jun 29, 2016

Based on the discussion on #3251 regarding JRuby and other values that can appear in .ruby-version, I made this change to see if it can help to resolve the situation.

In order to change the precedence, I had to move the default for TargetRubyVersion from default.yml to code.

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Used the same coding conventions as the rest of the project.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • All tests are passing.
  • The new code doesn't generate RuboCop offenses.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.

TargetRubyVersion: 2.0
# If a value is specified for TargetRubyVersion then it is used.
# Else if .ruby-version exists and it contains an MRI version it is used.
# Otherwise the default (2.0) ruby is used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps clarify that these are MRI version numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to the start of the comment on line 76.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the final sentence - it should be something like Otherwise we fallback to the oldest officially supported Ruby version (2.0).

@bquorning
Copy link
Contributor

bquorning commented Jun 29, 2016

👍 besides that one last comment.

@aviflax
Copy link

aviflax commented Jun 29, 2016

This looks great!

end
end

context 'when TargetRubyVersion is unset' do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unset -> not set/null

@tjwp
Copy link
Contributor Author

tjwp commented Jun 29, 2016

@bbatsov Thanks for the feedback. I've pushed changes to address all of it.

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.

4 participants