uninstall: style fixes
Works around Rubycop not liking method names that start with `is_` by changing convention from singular to plural. I think it's better that way anyway.
This commit is contained in:
parent
c77040b346
commit
ca3562645c
@ -96,7 +96,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
class DependentsMessage
|
class DependentsMessage
|
||||||
attr :reqs, :deps
|
attr_reader :reqs, :deps
|
||||||
|
|
||||||
def initialize(requireds, dependents)
|
def initialize(requireds, dependents)
|
||||||
@reqs = requireds
|
@reqs = requireds
|
||||||
@ -105,11 +105,11 @@ module Homebrew
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def is(items)
|
def are(items)
|
||||||
items.count == 1 ? "is" : "are"
|
items.count == 1 ? "is" : "are"
|
||||||
end
|
end
|
||||||
|
|
||||||
def it(items)
|
def they(items)
|
||||||
items.count == 1 ? "it" : "they"
|
items.count == 1 ? "it" : "they"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -121,15 +121,15 @@ module Homebrew
|
|||||||
"brew uninstall --ignore-dependencies #{list reqs.map(&:name)}"
|
"brew uninstall --ignore-dependencies #{list reqs.map(&:name)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_required_by_deps
|
def are_required_by_deps
|
||||||
"#{is reqs} required by #{list deps}, which #{is deps} currently installed"
|
"#{are reqs} required by #{list deps}, which #{are deps} currently installed"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class DeveloperDependentsMessage < DependentsMessage
|
class DeveloperDependentsMessage < DependentsMessage
|
||||||
def output
|
def output
|
||||||
opoo <<-EOS.undent
|
opoo <<-EOS.undent
|
||||||
#{list reqs} #{is_required_by_deps}.
|
#{list reqs} #{are_required_by_deps}.
|
||||||
You can silence this warning with:
|
You can silence this warning with:
|
||||||
#{sample_command}
|
#{sample_command}
|
||||||
EOS
|
EOS
|
||||||
@ -140,7 +140,7 @@ module Homebrew
|
|||||||
def output
|
def output
|
||||||
ofail <<-EOS.undent
|
ofail <<-EOS.undent
|
||||||
Refusing to uninstall #{list reqs}
|
Refusing to uninstall #{list reqs}
|
||||||
because #{it reqs} #{is_required_by_deps}.
|
because #{they reqs} #{are_required_by_deps}.
|
||||||
You can override this and force removal with:
|
You can override this and force removal with:
|
||||||
#{sample_command}
|
#{sample_command}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user