class ChefCore::CLIUX::UI::PlainTextHeader
Public Class Methods
new(format, opts)
click to toggle source
# File lib/chef_core/cliux/ui/plain_text_header.rb, line 24 def initialize(format, opts) @format = format @output = opts[:output] @children = {} @threads = [] end
Public Instance Methods
auto_spin()
click to toggle source
# File lib/chef_core/cliux/ui/plain_text_header.rb, line 37 def auto_spin msg = @format.gsub(/:spinner/, " HEADER ") @output.puts(msg) @children.each do |child, block| @threads << Thread.new { block.call(child) } end @threads.each(&:join) end
register(child_format, child_opts, &block)
click to toggle source
# File lib/chef_core/cliux/ui/plain_text_header.rb, line 31 def register(child_format, child_opts, &block) child_opts[:output] = @output child = PlainTextElement.new(child_format, child_opts) @children[child] = block end