Class: Chef::Formatters::Dogeputter
- Inherits:
-
Outputter
- Object
- Outputter
- Chef::Formatters::Dogeputter
- Defined in:
- lib/chef/formatters/dogeputter.rb
Instance Method Summary collapse
-
#initialize(out, err) ⇒ Dogeputter
constructor
A new instance of Dogeputter.
- #puts(string, *colors) ⇒ Object
Constructor Details
#initialize(out, err) ⇒ Dogeputter
Returns a new instance of Dogeputter.
6 7 8 9 10 11 12 13 14 |
# File 'lib/chef/formatters/dogeputter.rb', line 6 def initialize(out, err) super(out, err) if Chef::Config[:color] load_doge('doge.txt') else load_doge('doge-ascii.txt') end @current_dogeline = 0 end |
Instance Method Details
#puts(string, *colors) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/chef/formatters/dogeputter.rb', line 16 def puts(string, *colors) if @current_dogeline >= @doge.length # no more doge printf("%-47s\t ", " ") else printf("%-30s\t ", @doge[@current_dogeline].chomp) end @out.puts string @current_dogeline += 1 end |