Skip to content

Commit

Permalink
Merge pull request #665 from robsdudeson/binstubs
Browse files Browse the repository at this point in the history
  • Loading branch information
searls authored Nov 14, 2024
2 parents 83daf21 + 0210ade commit 3abe01c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ on:

jobs:
test:

strategy:
matrix:
os: [ubuntu-latest]
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- "3.0"
- "3.1"
- "3.2"
- "3.3"

runs-on: ${{ matrix.os }}

Expand All @@ -32,4 +31,4 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests for Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
run: bundle config unset deployment && bundle exec rake
run: bundle config unset deployment && ./bin/rake
27 changes: 27 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rake", "rake")
7 changes: 3 additions & 4 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ rake install:local # Build and install standard-x.x.x.gem into system gems wi
rake release[remote] # Create tag vx.x.x and build and push standard-0.5.2.gem to rubygems.org
```

Most of these commands are depended on (read: run by) `rake release`, which is
Most of these commands are depended on (read: run by) `./bin/rake release`, which is
really the only one we'll need for releasing the gem to
[Rubygems.org](https://rubygems.org/gems/standard).

## Release steps

1. Make sure git is up to date and `bundle exec rake` exits cleanly
1. Make sure git is up to date and `./bin/rake` exits cleanly
1. If you upgraded a Rubocop dependency, be sure to lock it down in
`standard.gemspec`. To avoid being broken transitively, we stick to exact
release dependencies (e.g. "0.91.0" instead of "~> 0.91")
Expand All @@ -34,9 +34,8 @@ really the only one we'll need for releasing the gem to
1. Run `bundle` so that Bundler writes this version to `Gemfile.lock`
1. Commit `lib/standard/version.rb`, `Gemfile.lock`, and `CHANGELOG.md` together
with the message equal to the new version (e.g. "0.42.1")
1. Finally, run `bundle exec rake release`, which will hopefully succeed
1. Finally, run `./bin/rake release`, which will hopefully succeed
1. Provide your multi-factor-auth token when prompted to finish publishing the
gem
1. [Tweet](https://twitter.com) about your awesome new release! (Shameless
self-promotion is the most important part of open source software)

8 changes: 4 additions & 4 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ The official standard plug-ins that are included in standard are:

1. Update Rubocop plugin in the gemspec file and gem file.
1. Keep standard in the gem file up-to-date. This will bring any testing utilities in standard into the plug-in repository.
1. Run bundle exec rake to run the tests
1. Run `./bin/rake` to run the tests
1. Configure any cops that need to be configured so that the tests pass
1. Update the change log to the best of your ability and title it as unreleased
1. Make your commit for these updates and push to the main branch
1. Update the version in version.rb and update the version in the Changelog replacing the word “Unreleased”
1. Run bundle to write the new version number to the lock file
1. Run bundle exec release to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.
1. Run `./bin/rake release` to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.

## Updating Standard

1. Update Rubocop as well as Standard Performance in the gemspec file and gem file.
1. Run bundle exec rake to run the tests
1. Run `./bin/rake` to run the tests
1. Configure any cops that need to be configured so that the tests pass
1. Update the change log to the best of your ability and title it as unreleased
1. Make your commit for these updates and push to the main branch
1. Update the version in version.rb and update the version in the Changelog replacing the word “Unreleased”
1. Run bundle to write the new version number to the lock file
1. Run bundle exec release to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.
1. Run `./bin/rake` to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.

0 comments on commit 3abe01c

Please sign in to comment.