class Rvm2::Ui::Single
Attributes
handler[R]
Public Class Methods
new(handler = :console, rvm2_plugins = nil, *args)
click to toggle source
# File lib/rvm2/ui/single.rb, line 9 def initialize(handler = :console, rvm2_plugins = nil, *args) @rvm2_plugins = rvm2_plugins || Pluginator.find("rvm2", extends: [:first_class]) @handler = @rvm2_plugins.first_class!('ui/output', handler).new(@rvm2_plugins, *args) end
Public Instance Methods
command(name, &block)
click to toggle source
ui.command “message” { do_something; }
# File lib/rvm2/ui/single.rb, line 15 def command(name, &block) raise "No block given" unless block_given? @handler.start(name) status = block.call @handler.finish(status) status end
log(message, type = :log)
click to toggle source
ui.log ‘message’ ui.log ‘message’, :important standard types => :log, :warn, :important, :error in case unsupported type is used :log will be used
# File lib/rvm2/ui/single.rb, line 27 def log(message, type = :log) @handler.log(message, type) end
stderr()
click to toggle source
# File lib/rvm2/ui/single.rb, line 35 def stderr @handler.stderr end
stdout()
click to toggle source
# File lib/rvm2/ui/single.rb, line 31 def stdout @handler.stdout end