Remove Cask’s CLI#debug?.
This commit is contained in:
parent
9e821863d0
commit
a44d4ce88b
@ -74,8 +74,6 @@ module Hbc
|
||||
end
|
||||
|
||||
def dumpcask
|
||||
return unless CLI.debug?
|
||||
|
||||
odebug "Cask instance dumps in YAML:"
|
||||
odebug "Cask instance toplevel:", to_yaml
|
||||
[
|
||||
|
||||
@ -71,7 +71,6 @@ module Hbc
|
||||
|
||||
FLAGS = {
|
||||
["--[no-]binaries", :binaries] => true,
|
||||
["--debug", :debug] => false,
|
||||
["--verbose", :verbose] => false,
|
||||
["--outdated", :outdated] => false,
|
||||
["--help", :help] => false,
|
||||
@ -158,7 +157,7 @@ module Hbc
|
||||
run_command(command, *rest)
|
||||
rescue CaskError, CaskSha256MismatchError, ArgumentError => e
|
||||
msg = e.message
|
||||
msg << e.backtrace.join("\n") if debug?
|
||||
msg << e.backtrace.join("\n") if ARGV.debug?
|
||||
onoe msg
|
||||
exit 1
|
||||
rescue StandardError, ScriptError, NoMemoryError => e
|
||||
@ -239,7 +238,6 @@ module Hbc
|
||||
|
||||
# for compat with Homebrew, not certain if this is desirable
|
||||
self.verbose = true if ARGV.verbose?
|
||||
self.debug = true if ARGV.debug?
|
||||
|
||||
remaining
|
||||
end
|
||||
|
||||
@ -12,7 +12,6 @@ module Hbc
|
||||
end
|
||||
|
||||
def self.dump_casks(*cask_tokens)
|
||||
CLI.debug = true # Yuck. At the moment this is the only way to make dumps visible
|
||||
count = 0
|
||||
cask_tokens.each do |cask_token|
|
||||
begin
|
||||
|
||||
@ -154,7 +154,7 @@ module Hbc
|
||||
def self._parse_plist(command, output)
|
||||
raise CaskError, "Empty plist input" unless output =~ /\S/
|
||||
output.sub!(/\A(.*?)(<\?\s*xml)/m, '\2')
|
||||
_warn_plist_garbage(command, Regexp.last_match[1]) if CLI.debug?
|
||||
_warn_plist_garbage(command, Regexp.last_match[1]) if ARGV.debug?
|
||||
output.sub!(%r{(<\s*/\s*plist\s*>)(.*?)\Z}m, '\1')
|
||||
_warn_plist_garbage(command, Regexp.last_match[2])
|
||||
xml = Plist.parse_xml(output)
|
||||
|
||||
@ -29,7 +29,7 @@ end
|
||||
# global methods
|
||||
|
||||
def odebug(title, *sput)
|
||||
return unless Hbc::CLI.debug?
|
||||
return unless ARGV.debug?
|
||||
puts Formatter.headline(title, color: :magenta)
|
||||
puts sput unless sput.empty?
|
||||
end
|
||||
|
||||
@ -120,17 +120,6 @@ describe Hbc::CLI, :cask do
|
||||
end
|
||||
end
|
||||
|
||||
describe "--debug" do
|
||||
it "sets the Cask debug method to true" do
|
||||
begin
|
||||
Hbc::CLI.process_options %w[help --debug]
|
||||
expect(Hbc::CLI.debug?).to be true
|
||||
ensure
|
||||
Hbc::CLI.debug = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "--help" do
|
||||
it "sets the Cask help method to true" do
|
||||
begin
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user