Class: Rvm2::Ui::Output::Fake

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/rvm2/ui/output/fake.rb

Defined Under Namespace

Classes: Element, StringElements

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rvm2_plugins) ⇒ Fake

Returns a new instance of Fake.



31
32
33
34
35
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 31

def initialize(rvm2_plugins)
  @rvm2_plugins = rvm2_plugins
  @root = Element.new(nil, :group, nil)
  @current = @root
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



30
31
32
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 30

def current
  @current
end

#rootObject (readonly)

Returns the value of attribute root.



30
31
32
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 30

def root
  @root
end

Instance Method Details

#finish(status) ⇒ Object



43
44
45
46
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 43

def finish(status)
  @current.status = status
  @current = @current.parent
end

#log(message, type = :log) ⇒ Object



48
49
50
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 48

def log(message, type = :log)
  @current.list << Element.new(message, type)
end

#start(name) ⇒ Object



37
38
39
40
41
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 37

def start(name)
  created = Element.new(name, :group, @current)
  @current.list << created
  @current =  created
end

#stderrObject



56
57
58
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 56

def stderr
  @stderr ||= StringElements.new(self, :stderr)
end

#stdoutObject



52
53
54
# File 'lib/plugins/rvm2/ui/output/fake.rb', line 52

def stdout
  @stdout ||= StringElements.new(self, :stdout)
end