Permalink
Browse files

Make sure we only print out info if we are verbose

  • Loading branch information...
1 parent e000e55 commit 64453b790abe2cba852de4767d5413072530a555 @ferrous26 committed Feb 2, 2012
Showing with 13 additions and 5 deletions.
  1. +13 −5 lib/rubygems-compile/compiler.rb
@@ -16,11 +16,11 @@ def call gem
@spec = gem.is_a?(Gem::Specification) ? gem : gem.spec
if @spec.name == 'rubygems-compile'
- alert_info 'You cannot compile rubygems-compile' if @config.really_verbose
+ alert_info 'You cannot compile rubygems-compile' if really_verbose
return
end
- say compilation_message if @config.verbose
+ say compilation_message if verbose
gem_files.each do |file|
message = compile_file_msg(file)
@@ -34,7 +34,7 @@ def call gem
files: [absolute_file_path]
).run
end
- say message if @config.really_verbose
+ say message if really_verbose
end
end
alias_method :compile, :call
@@ -51,7 +51,7 @@ def unsafe? file
end
def compilation_message
- slash = @config.really_verbose ? '/' : ''
+ slash = really_verbose ? '/' : ''
"Compiling #{@spec.full_name}#{slash}"
end
@@ -82,11 +82,19 @@ def compile_file_msg file
dirs.each_with_index do |dir, index|
unless @current_directory[index] == dir
@current_directory[index] = dir
- say( "\t" * (index + 1) + dir + File::SEPARATOR)
+ say( "\t" * (index + 1) + dir + File::SEPARATOR) if really_verbose
end
end
"#{tabs}#{name} => #{name}o"
end
+ def verbose
+ @config.verbose
+ end
+
+ def really_verbose
+ @config.really_verbose
+ end
+
end

0 comments on commit 64453b7

Please sign in to comment.