brew vendor-gems: commit updates.
This commit is contained in:
parent
8b12b6d04b
commit
1f98c60b81
@ -83,7 +83,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11
|
|||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.0.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.0.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.17.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.17.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.3/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.3/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.11.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.11.2/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.4.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.4.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.2/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.2/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.1/lib"
|
||||||
|
@ -194,7 +194,11 @@ module RuboCop
|
|||||||
def database_yaml
|
def database_yaml
|
||||||
return nil unless File.exist?('config/database.yml')
|
return nil unless File.exist?('config/database.yml')
|
||||||
|
|
||||||
yaml = YAML.load_file('config/database.yml')
|
yaml = if YAML.respond_to?(:unsafe_load_file)
|
||||||
|
YAML.unsafe_load_file('config/database.yml')
|
||||||
|
else
|
||||||
|
YAML.load_file('config/database.yml')
|
||||||
|
end
|
||||||
return nil unless yaml.is_a? Hash
|
return nil unless yaml.is_a? Hash
|
||||||
|
|
||||||
config = yaml['development']
|
config = yaml['development']
|
@ -32,10 +32,10 @@ module RuboCop
|
|||||||
RESTRICT_ON_SEND = %i[first take].freeze
|
RESTRICT_ON_SEND = %i[first take].freeze
|
||||||
|
|
||||||
def on_send(node)
|
def on_send(node)
|
||||||
return unless where_method?(node.receiver)
|
return unless node.arguments.empty? && where_method?(node.receiver)
|
||||||
return if ignore_where_first? && node.method?(:first)
|
return if ignore_where_first? && node.method?(:first)
|
||||||
|
|
||||||
range = range_between(node.receiver.loc.selector.begin_pos, node.loc.selector.end_pos)
|
range = offense_range(node)
|
||||||
|
|
||||||
add_offense(range, message: format(MSG, method: node.method_name)) do |corrector|
|
add_offense(range, message: format(MSG, method: node.method_name)) do |corrector|
|
||||||
autocorrect(corrector, node)
|
autocorrect(corrector, node)
|
||||||
@ -51,6 +51,10 @@ module RuboCop
|
|||||||
receiver.respond_to?(:method?) && receiver.method?(:where)
|
receiver.respond_to?(:method?) && receiver.method?(:where)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def offense_range(node)
|
||||||
|
range_between(node.receiver.loc.selector.begin_pos, node.loc.selector.end_pos)
|
||||||
|
end
|
||||||
|
|
||||||
def autocorrect(corrector, node)
|
def autocorrect(corrector, node)
|
||||||
return if node.method?(:first)
|
return if node.method?(:first)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user