diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index ff496bbbef..ceb4d9225f 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -32,4 +32,4 @@ jobs: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Run tests - run: bundle exec rspec spec + run: bin/rspec diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f37f087b27..97e8a69350 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ 1. Fork [the repo](https://github.com/RubyMoney/money) 2. Grab dependencies: `bundle install` -3. Make sure everything is working: `bundle exec rake spec` +3. Make sure everything is working: `bin/rake spec` 4. Make your changes 5. Test your changes 6. Create a Pull Request diff --git a/README.md b/README.md index 1f010ada7c..4e9076d53c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The development version (hosted on Github) can be installed with: git clone git://github.com/RubyMoney/money.git cd money - rake install + bin/rake install ## Usage diff --git a/Rakefile b/Rakefile index 061d06aede..2379d19467 100644 --- a/Rakefile +++ b/Rakefile @@ -2,8 +2,8 @@ # Clean # -# rake clean -# rake clobber +# bin/rake clean +# bin/rake clobber require "rake/clean" @@ -11,8 +11,8 @@ CLOBBER.include("doc", ".yardoc") # Bundler # -# rake build -# rake release +# bin/rake build +# bin/rake release require "bundler/gem_tasks" @@ -20,7 +20,7 @@ gemspec = Gem::Specification.load("money.gemspec") # RuboCop # -# rake rubocop +# bin/rake rubocop require "rubocop/rake_task" @@ -28,7 +28,7 @@ RuboCop::RakeTask.new # Yard # -# rake yard +# bin/rake yard require "yard" @@ -41,7 +41,7 @@ end # RSpec # -# rake spec +# bin/rake spec require "rspec/core/rake_task" @@ -52,7 +52,7 @@ end # File permissions # -# rake check_permissions +# bin/rake check_permissions desc "Check file permissions" task :check_permissions do @@ -76,6 +76,6 @@ task spec: :check_permissions # Default task # -# rake +# bin/rake task default: [:rubocop, :spec] diff --git a/UPGRADING-7.0.md b/UPGRADING-7.0.md index 3a33fe9905..4e867077c8 100644 --- a/UPGRADING-7.0.md +++ b/UPGRADING-7.0.md @@ -315,7 +315,7 @@ currency.cents_based? # => true 3. **Run your test suite:** ```bash - bundle exec rake test # or rspec, etc. + bin/rake test # or rspec, etc. ``` 4. **Check for deprecation warnings** and address them. diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000000..4eb7d7bf0a --- /dev/null +++ b/bin/rake @@ -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") diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 0000000000..cb53ebe5f0 --- /dev/null +++ b/bin/rspec @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rspec' 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("rspec-core", "rspec") diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f080ff1750..c955361b6d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -16,7 +16,7 @@ Dir["./spec/support/**/*.rb"].each { |f| require f } -# This file was generated by the `rspec --init` command. Conventionally, all +# This file was generated by the `bin/rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require it in any