UpgradeTools
UpgradeTools is a gem meant to bundle ad-hoc scripts and tasks that tackle common
Ruby/Rails upgrade chores, like updating you .ruby-version, your Gemfile, and your
gemspec.
Installation
Install the gem and add to the application's Gemfile by executing:
bundle add upgrade_tools
If bundler is not being used to manage dependencies, install the gem by executing:
gem install upgrade_tools
Usage
Executables
Installing the gem will install the executables listed in this section, which you may
run directly or by using bundle, depending on how you installed the gem.
This gem uses dry-cli, which means that simply running a given executable (or using the
-h flag) will provide guidance on how to use it. If an executable has a sub-command (or
multiple sub-commands), you can also use -h to get more information about it.
ruby-version
ruby-version set NEW_VERSION [FILENAME]
This command updates the .ruby-version file referred to by FILENAME to the given
NEW_VERSION. If FILENAME is not provided, ./.ruby-version is assumed.
CAVEAT for
bundle execuses:If you run this from a project with a given Ruby version, like 3.4, and update its
.ruby-versionfile to 4.0, you won't be able to run the command again because the Ruby version changed. You mustbundle installagain (the command will print out a couple of post-command instructions to remind you this).
Development
TODO: Update this section to reflect minitest use (vs. RSpec)
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console for an interactive prompt that will
allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a
new version, update the version number in version.rb, and then run
bundle exec rake release, which will create a git tag for the version, push git commits
and the created tag, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/upgrade_tools.
License
The gem is available as open source under the terms of the MIT License.