Update `TargetRubyVersion` to 2.7 in `.rubocop.yml`
This commit is contained in:
parent
ba97e9f918
commit
2e9c0e04c5
|
@ -4,7 +4,7 @@ require:
|
|||
- rubocop-rails
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.5
|
||||
TargetRubyVersion: 2.7
|
||||
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
||||
# to ignore them, so only the ones explicitly set in this file are enabled.
|
||||
DisabledByDefault: true
|
||||
|
|
|
@ -63,11 +63,7 @@ module Rails
|
|||
numbered_destination = File.join(dir, ["%migration_number%", base].join("_"))
|
||||
|
||||
file = create_migration numbered_destination, nil, config do
|
||||
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
|
||||
ERB.new(::File.binread(source), trim_mode: "-", eoutvar: "@output_buffer").result(context)
|
||||
else
|
||||
ERB.new(::File.binread(source), nil, "-", "@output_buffer").result(context)
|
||||
end
|
||||
ERB.new(::File.binread(source), trim_mode: "-", eoutvar: "@output_buffer").result(context)
|
||||
end
|
||||
Rails::Generators.add_generated_file(file)
|
||||
end
|
||||
|
|
|
@ -80,11 +80,7 @@ module GeneratorsTestHelper
|
|||
end
|
||||
|
||||
def evaluate_template(file, locals = {})
|
||||
erb = if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
|
||||
ERB.new(File.read(file), trim_mode: "-", eoutvar: "@output_buffer")
|
||||
else
|
||||
ERB.new(File.read(file), nil, "-", "@output_buffer")
|
||||
end
|
||||
erb = ERB.new(File.read(file), trim_mode: "-", eoutvar: "@output_buffer")
|
||||
context = Class.new do
|
||||
locals.each do |local, value|
|
||||
class_attribute local, default: value
|
||||
|
|
Loading…
Reference in New Issue