diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d265995a..73ddae19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,6 +88,7 @@ jobs: - uses: actions/checkout@v4 - name: Use latest RuboCop RSpec from `master` run: | + sed -e '/rubocop-rspec/d' -i Gemfile echo "gem 'rubocop-rspec', github: 'rubocop/rubocop-rspec'" > Gemfile.local - uses: ruby/setup-ruby@v1 with: @@ -102,7 +103,7 @@ jobs: - uses: actions/checkout@v4 - name: Use latest RSpec 4 from `4-0-dev` branch run: | - sed -e '/rspec/d' -i Gemfile + sed -e "/^gem 'rspec/d" -i Gemfile cat << EOF > Gemfile.local gem 'rspec', github: 'rspec/rspec-metagem', branch: '4-0-dev' gem 'rspec-core', github: 'rspec/rspec-core', branch: '4-0-dev' diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a35ed07..f5d658b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Master (Unreleased) +- Implicit dependency on RuboCop RSpec. Note that if you use rubocop-rspec_rails, you must also explicitly add rubocop-rspec to the Gemfile, because you are changing to an implicit dependency on RuboCop RSpec. ([@ydah]) + ## 2.28.0 (2024-03-28) - Extracted from `rubocop-rspec` into a separate repository. ([@ydah]) diff --git a/Gemfile b/Gemfile index 04687217..a1e1c2f9 100644 --- a/Gemfile +++ b/Gemfile @@ -14,5 +14,8 @@ gem 'rubocop-rake', '~> 0.6' gem 'simplecov', '>= 0.19' gem 'yard' +# TODO: Move to gemspec when RuboCop RSpec v3 is released. +gem 'rubocop-rspec', '~> 2.27' + local_gemfile = 'Gemfile.local' eval_gemfile(local_gemfile) if File.exist?(local_gemfile) diff --git a/README.md b/README.md index 34e5e217..a3cc6eb2 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,17 @@ ## Installation -Just install the `rubocop-rspec_rails` gem +**This gem implicitly depends on the `rubocop-rspec` gem, so you should install it first.** +Just install the `rubocop-rspec` and `rubocop-rspec_rails` gem ```bash -gem install rubocop-rspec_rails +gem install rubocop-rspec rubocop-rspec_rails ``` or if you use bundler put this in your `Gemfile` ```ruby +gem 'rubocop-rspec', require: false gem 'rubocop-rspec_rails', require: false ``` diff --git a/docs/modules/ROOT/pages/installation.adoc b/docs/modules/ROOT/pages/installation.adoc index 9ef3d5af..5019c5db 100644 --- a/docs/modules/ROOT/pages/installation.adoc +++ b/docs/modules/ROOT/pages/installation.adoc @@ -1,15 +1,17 @@ = Installation -Just install the `rubocop-rspec_rails` gem +*This gem implicitly depends on the `rubocop-rspec` gem, so you should install it first.* +Just install the `rubocop-rspec` and `rubocop-rspec_rails` gem [source,bash] ---- -gem install rubocop-rspec_rails +gem install rubocop-rspec rubocop-rspec_rails ---- or if you use bundler put this in your `Gemfile` [source,ruby] ---- -gem 'rubocop-rspec_rails' +gem 'rubocop-rspec', require: false +gem 'rubocop-rspec_rails', require: false ---- diff --git a/rubocop-rspec_rails.gemspec b/rubocop-rspec_rails.gemspec index 58f12095..10a60dee 100644 --- a/rubocop-rspec_rails.gemspec +++ b/rubocop-rspec_rails.gemspec @@ -35,5 +35,4 @@ Gem::Specification.new do |spec| } spec.add_runtime_dependency 'rubocop', '~> 1.40' - spec.add_runtime_dependency 'rubocop-rspec', '~> 2.27' end