Commit d0344d84 authored by Fabio Pelosin's avatar Fabio Pelosin

[Command] Fix issue that lead to ignoring the --verbose option.

parent 69daa1dc
...@@ -24,7 +24,7 @@ module Pod ...@@ -24,7 +24,7 @@ module Pod
def self.parse(argv) def self.parse(argv)
command = super command = super
unless command.is_a?(Setup) || ENV['SKIP_SETUP'] unless command.is_a?(Setup) || ENV['SKIP_SETUP']
Setup.new(CLAide::ARGV.new([])).run_if_needed Setup.run_if_needed
end end
command command
end end
...@@ -48,10 +48,13 @@ module Pod ...@@ -48,10 +48,13 @@ module Pod
end end
end end
# @todo If a command is run inside another one some settings which where
# true might return false.
#
def initialize(argv) def initialize(argv)
config.silent = argv.flag?('silent') config.silent ||= argv.flag?('silent')
super super
config.verbose = self.verbose? config.verbose ||= self.verbose?
# TODO we should probably not even load colored unless needed # TODO we should probably not even load colored unless needed
String.send(:define_method, :colorize) { |string , _| string } unless self.colorize_output? String.send(:define_method, :colorize) { |string , _| string } unless self.colorize_output?
end end
......
...@@ -24,8 +24,12 @@ module Pod ...@@ -24,8 +24,12 @@ module Pod
super super
end end
def self.dir
Config.instance.repos_dir + 'master'
end
def dir def dir
config.repos_dir + 'master' self.class.dir
end end
def read_only_url def read_only_url
...@@ -82,8 +86,9 @@ module Pod ...@@ -82,8 +86,9 @@ module Pod
end end
end end
def run_if_needed def self.run_if_needed
run unless dir.exist? && Repo.compatible?('master') self.new(CLAide::ARGV.new([])).run unless
dir.exist? && Repo.compatible?('master')
end end
def run def run
......
...@@ -49,7 +49,7 @@ describe Pod::Command::Setup do ...@@ -49,7 +49,7 @@ describe Pod::Command::Setup do
output = run_command('setup') output = run_command('setup')
output.should.include "Setup completed" output.should.include "Setup completed"
Pod::UI.output = '' Pod::UI.output = ''
command('setup').run_if_needed Pod::Command::Setup.run_if_needed
Pod::UI.output.should == '' Pod::UI.output.should == ''
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment