Skip to content

Commit d115ed5

Browse files
committed
Implicit dependency on RuboCop RSpec
It is extracted from RuboCop RSpec, but needs to rely on rubocop-rspec_rails from RuboCop RSpec, and RuboCop RSpec Rails also needs to rely on rubocop-rspec. This makes them interdependent, and if you explicitly specify a dependency, you are stuck in an infinite loop. ``` ❯ bundle install Your bundle requires gems that depend on each other, creating an infinite loop. Please remove either gem 'rubocop-rspec' or gem 'rubocop-rspec_rails' and try again. ``` Therefore, this PR changes the dependency to be implicit. The next major version update of RuboCop RSpec will remove the dependency on rubocop-rspec_rails, so we will change the dependency to be explicit at that point.
1 parent 9a4c2a7 commit d115ed5

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Master (Unreleased)
44

5+
- 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])
6+
57
## 2.28.0 (2024-03-28)
68

79
- Extracted from `rubocop-rspec` into a separate repository. ([@ydah])

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ gem 'rubocop-rake', '~> 0.6'
1414
gem 'simplecov', '>= 0.19'
1515
gem 'yard'
1616

17+
# TODO: Move to gemspec when RuboCop RSpec v3 is released.
18+
gem 'rubocop-rspec', '~> 2.27'
19+
1720
local_gemfile = 'Gemfile.local'
1821
eval_gemfile(local_gemfile) if File.exist?(local_gemfile)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99

1010
## Installation
1111

12-
Just install the `rubocop-rspec_rails` gem
12+
**This gem implicitly depends on the `rubocop-rspec` gem, so you should install it first.**
13+
Just install the `rubocop-rspec` and `rubocop-rspec_rails` gem
1314

1415
```bash
15-
gem install rubocop-rspec_rails
16+
gem install rubocop-rspec rubocop-rspec_rails
1617
```
1718

1819
or if you use bundler put this in your `Gemfile`
1920

2021
```ruby
22+
gem 'rubocop-rspec', require: false
2123
gem 'rubocop-rspec_rails', require: false
2224
```
2325

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
= Installation
22

3-
Just install the `rubocop-rspec_rails` gem
3+
*This gem implicitly depends on the `rubocop-rspec` gem, so you should install it first.*
4+
Just install the `rubocop-rspec` and `rubocop-rspec_rails` gem
45

56
[source,bash]
67
----
7-
gem install rubocop-rspec_rails
8+
gem install rubocop-rspec rubocop-rspec_rails
89
----
910

1011
or if you use bundler put this in your `Gemfile`
1112

1213
[source,ruby]
1314
----
14-
gem 'rubocop-rspec_rails'
15+
gem 'rubocop-rspec', require: false
16+
gem 'rubocop-rspec_rails', require: false
1517
----

rubocop-rspec_rails.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,4 @@ Gem::Specification.new do |spec|
3535
}
3636

3737
spec.add_runtime_dependency 'rubocop', '~> 1.40'
38-
spec.add_runtime_dependency 'rubocop-rspec', '~> 2.27'
3938
end

0 commit comments

Comments
 (0)