From 528d555e378e9900ffda40c8ff3627e0609a048c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 2 Jul 2009 15:55:21 +0200 Subject: Make invoke output white and use padding. --- railties/lib/generators/base.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'railties/lib/generators/base.rb') diff --git a/railties/lib/generators/base.rb b/railties/lib/generators/base.rb index aeb79dd339..4b47ebc49b 100644 --- a/railties/lib/generators/base.rb +++ b/railties/lib/generators/base.rb @@ -118,7 +118,7 @@ module Rails def self.hook_for(*names, &block) options = names.extract_options! as = options.fetch(:as, generator_name) - verbose = options.fetch(:verbose, :blue) + verbose = options.fetch(:verbose, :white) names.each do |name| default = { :desc => "#{name.to_s.humanize} to be invoked", :banner => "NAME" } @@ -196,7 +196,7 @@ module Rails def self.invoke_if(*names, &block) options = names.extract_options!.merge(:type => :boolean) as = options.fetch(:as, generator_name) - verbose = options.fetch(:verbose, :blue) + verbose = options.fetch(:verbose, :white) names.each do |name| class_option name, options @@ -267,11 +267,13 @@ module Rails # in case the user wants to customize how the class is invoked. # def invoke_class_with_block(name, klass) #:nodoc: + shell.padding += 1 if block = self.class.invocation_blocks[name] block.call(self, klass) else invoke klass end + shell.padding -= 1 end # Check whether the given class names are already taken by user -- cgit v1.2.3