Skip to content

Commit 4303e22

Browse files
committed
Modernize rubocop.
1 parent d501600 commit 4303e22

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.rubocop.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
require:
1+
plugins:
22
- rubocop-rspec
33
- rubocop-performance
44

55
AllCops:
66
DisabledByDefault: false
7-
TargetRubyVersion: 3.0
7+
TargetRubyVersion: 3.1
88
NewCops: enable
99
SuggestExtensions: false
1010
Exclude:
@@ -152,7 +152,10 @@ RSpec/DescribedClass:
152152
RSpec/DescribeClass:
153153
Enabled: false
154154

155-
RSpec/FilePath:
155+
RSpec/SpecFilePathFormat:
156+
Enabled: false
157+
158+
RSpec/SpecFilePathSuffix:
156159
Enabled: false
157160

158161
RSpec/MultipleExpectations:

lib/xpath/union.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def expression
1515
:union
1616
end
1717

18-
def each(&block)
19-
arguments.each(&block)
18+
def each(&)
19+
arguments.each(&)
2020
end
2121

2222
def method_missing(*args) # rubocop:disable Style/MissingRespondToMissing

spec/union_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
@expr1 = XPath.generate { |x| x.descendant(:p) }
2121
@expr2 = XPath.generate { |x| x.descendant(:div) }
2222
@collection = XPath::Union.new(@expr1, @expr2)
23-
exprs = []
24-
@collection.each { |expr| exprs << expr }
23+
exprs = @collection.map { |expr| expr }
2524
expect(exprs).to eq [@expr1, @expr2]
2625
end
2726
end

0 commit comments

Comments
 (0)