Skip to content

Use .ruby-version file#458

Open
tjschuck wants to merge 1 commit intotip4commit:masterfrom
tjschuck:use-ruby-version-file
Open

Use .ruby-version file#458
tjschuck wants to merge 1 commit intotip4commit:masterfrom
tjschuck:use-ruby-version-file

Conversation

@tjschuck
Copy link
Copy Markdown

This is pretty much the community standard now, and is supported by all the major version managers (rbenv, rvm, chruby, etc.) and tooling (Rubocop, the ruby/setup-ruby@v1 GitHub action, etc.)

Makes it a little more seamless to get up and running to make contributions.

This is pretty much the community standard now, and is supported by all the major version managers (rbenv, rvm, chruby, etc.) and tooling (Rubocop, the `ruby/setup-ruby@v1` GitHub action, etc.)

set :rvm_type, :user
set :rvm_ruby_version, '3.2.6'
set :rvm_ruby_version, File.read("#{File.dirname(__FILE__)}/../.ruby-version").strip
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This style recommended/documented here: https://github.com/capistrano/rbenv?tab=readme-ov-file#usage

- rubocop-rspec

AllCops:
TargetRubyVersion: 3.2
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

https://docs.rubocop.org/rubocop/configuration.html#setting-the-target-ruby-version

If a TargetRubyVersion is not specified in your config, then RuboCop will check your project for a series of other files where the Ruby version may be specified already. The files that will be checked are (in this order): *.gemspec, .ruby-version, .tool-versions, and Gemfile.lock.

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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