Skip to content

Commit ab0714a

Browse files
committed
Target new syntax in rubocop
1 parent 37bf502 commit ab0714a

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

.rubocop.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This is a config synced from dry-rb/template-gem repo
22

33
AllCops:
4-
TargetRubyVersion: 3.0
5-
NewCops: disable
4+
TargetRubyVersion: 3.1
5+
NewCops: enable
66
SuggestExtensions: false
77
Exclude:
88
- "**/vendor/**/*" # For GitHub Actions, see rubocop/rubocop#9832

lib/dry/logic/builder.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ module Builder
2828
# p is_zero.call(1) # => false
2929
# p is_zero.call(0) # => true
3030
# p is_zero.call(-1) # => false
31-
def call(&context)
32-
Context.instance.call(&context)
31+
def call(&)
32+
Context.instance.call(&)
3333
end
3434
module_function :call
3535
alias_method :build, :call
@@ -44,8 +44,8 @@ module Predicates
4444
end
4545

4646
# @see Builder#call
47-
def call(&context)
48-
instance_eval(&context)
47+
def call(&)
48+
instance_eval(&)
4949
end
5050

5151
# Defines custom predicate

lib/dry/logic/operations/check.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Check < Unary
88

99
def self.new(rule, **options)
1010
if options[:evaluator]
11-
super(rule, **options)
11+
super
1212
else
1313
keys = options.fetch(:keys)
1414
evaluator = Evaluator::Set.new(keys)

lib/dry/logic/predicates.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,12 @@ def uuid_v8?(input)
272272
end
273273

274274
def uri?(schemes, input)
275-
uri_format = URI::DEFAULT_PARSER.make_regexp(schemes)
275+
uri_format = ::URI::DEFAULT_PARSER.make_regexp(schemes)
276276
format?(uri_format, input)
277277
end
278278

279279
def uri_rfc3986?(input)
280-
format?(URI::RFC3986_Parser::RFC3986_URI, input)
280+
format?(::URI::RFC3986_Parser::RFC3986_URI, input)
281281
end
282282

283283
# This overrides Object#respond_to? so we need to make it compatible
@@ -287,8 +287,8 @@ def respond_to?(method, input = Undefined)
287287
input.respond_to?(method)
288288
end
289289

290-
def predicate(name, &block)
291-
define_singleton_method(name, &block)
290+
def predicate(name, &)
291+
define_singleton_method(name, &)
292292
end
293293

294294
def deprecated(name, in_favor_of)

spec/spec_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
SPEC_ROOT = Pathname(__dir__)
1515

16-
Dir[SPEC_ROOT.join("shared/**/*.rb")].sort.each(&method(:require))
17-
Dir[SPEC_ROOT.join("support/**/*.rb")].sort.each(&method(:require))
16+
Dir[SPEC_ROOT.join("shared/**/*.rb")].each(&method(:require))
17+
Dir[SPEC_ROOT.join("support/**/*.rb")].each(&method(:require))
1818

1919
RSpec.configure do |config|
2020
config.include Module.new {

0 commit comments

Comments
 (0)