Permalink
Browse files

add colors and tweak format a bit more

  • Loading branch information...
1 parent b8e2b79 commit 9c87643daba3f33f7657b5da1eb3f5892887c787 @rcarver committed Jul 23, 2012
Showing with 10 additions and 9 deletions.
  1. +3 −3 lib/config/core/executable.rb
  2. +6 −5 lib/config/pattern.rb
  3. +1 −1 test/integration/blueprint_test.rb
@@ -18,14 +18,14 @@ def execute
end
case run_mode
when :create
- log << "#{prefix}Create #{self}"
+ log << log.colorize("#{prefix}Create #{self}", :green)
prepare unless skip
create unless skip or noop?
when :destroy
- log << "#{prefix}Destroy #{self}"
+ log << log.colorize("#{prefix}Destroy #{self}", :red)
destroy unless skip or noop?
when :skip
- log << "Skip #{self}"
+ log << log.colorize("Skip #{self}", :cyan)
else
raise "Unknown run_mode #{run_mode.inspect}"
end
View
@@ -53,23 +53,24 @@ def add(pattern_class, &block)
accumulation << pattern
# Log the pattern addition.
- log << "+ #{pattern_class}"
+ log << log.colorize("+ #{pattern_class}", :green)
# Indent two to align with the conclusion below. This allows log output
# triggered by the pattern setup to fall within this block.
- log.indent do
+ log.indent(2) do
yield pattern if block_given?
end
- # Show the final pattern.
- log << " #{pattern}"
-
# Indent and call. This triggers a recursive addition of the entire
# pattern branch.
log.indent do
pattern.call
+
+ # Show the final pattern.
+ log << log.colorize(pattern, :cyan)
end
+
nil
end
@@ -296,7 +296,7 @@ def log_execute(*args)
log_execute.must_equal <<-STR
Accumulate Blueprint webserver
+ BlueprintTest::Test
- Read webserver.my_name => "bob"
+ Read webserver.my_name => "bob"
[BlueprintTest::Test name:"bob"]
Validate Blueprint webserver
Resolve Blueprint webserver

0 comments on commit 9c87643

Please sign in to comment.