Fix Lint/NestedMethodDefinition in dev-cmd/bottle.rb`.
This commit is contained in:
parent
70fc825787
commit
5b2ae6885b
@ -34,11 +34,6 @@ Lint/Loop:
|
|||||||
Exclude:
|
Exclude:
|
||||||
- 'Homebrew/patch.rb'
|
- 'Homebrew/patch.rb'
|
||||||
|
|
||||||
# Offense count: 1
|
|
||||||
Lint/NestedMethodDefinition:
|
|
||||||
Exclude:
|
|
||||||
- 'Homebrew/dev-cmd/bottle.rb'
|
|
||||||
|
|
||||||
# Offense count: 28
|
# Offense count: 28
|
||||||
Lint/RescueException:
|
Lint/RescueException:
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|||||||
@ -44,9 +44,9 @@ module Homebrew
|
|||||||
def keg_contain?(string, keg, ignores)
|
def keg_contain?(string, keg, ignores)
|
||||||
@put_string_exists_header, @put_filenames = nil
|
@put_string_exists_header, @put_filenames = nil
|
||||||
|
|
||||||
def print_filename(string, filename)
|
print_filename = lambda do |str, filename|
|
||||||
unless @put_string_exists_header
|
unless @put_string_exists_header
|
||||||
opoo "String '#{string}' still exists in these files:"
|
opoo "String '#{str}' still exists in these files:"
|
||||||
@put_string_exists_header = true
|
@put_string_exists_header = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ module Homebrew
|
|||||||
result ||= !linked_libraries.empty?
|
result ||= !linked_libraries.empty?
|
||||||
|
|
||||||
if ARGV.verbose?
|
if ARGV.verbose?
|
||||||
print_filename(string, file) unless linked_libraries.empty?
|
print_filename.call(string, file) unless linked_libraries.empty?
|
||||||
linked_libraries.each do |lib|
|
linked_libraries.each do |lib|
|
||||||
puts " #{Tty.gray}-->#{Tty.reset} links to #{lib}"
|
puts " #{Tty.gray}-->#{Tty.reset} links to #{lib}"
|
||||||
end
|
end
|
||||||
@ -91,7 +91,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
next unless ARGV.verbose? && !text_matches.empty?
|
next unless ARGV.verbose? && !text_matches.empty?
|
||||||
print_filename string, file
|
print_filename.call(string, file)
|
||||||
text_matches.first(MAXIMUM_STRING_MATCHES).each do |match, offset|
|
text_matches.first(MAXIMUM_STRING_MATCHES).each do |match, offset|
|
||||||
puts " #{Tty.gray}-->#{Tty.reset} match '#{match}' at offset #{Tty.em}0x#{offset}#{Tty.reset}"
|
puts " #{Tty.gray}-->#{Tty.reset} match '#{match}' at offset #{Tty.em}0x#{offset}#{Tty.reset}"
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user