Class: Blender::Utils::UI

Inherits:
Object
  • Object
show all
Defined in:
lib/blender/utils/ui.rb

Instance Method Summary collapse

Constructor Details

#initializeUI

Returns a new instance of UI.



23
24
25
26
# File 'lib/blender/utils/ui.rb', line 23

def initialize
  @mutex = Mutex.new
  @highline = HighLine.new
end

Instance Method Details

#color(string, *colors) ⇒ Object



46
47
48
# File 'lib/blender/utils/ui.rb', line 46

def color(string, *colors)
  @highline.color(string, *colors)
end

#puts(string) ⇒ Object



28
29
30
31
32
# File 'lib/blender/utils/ui.rb', line 28

def puts(string)
  @mutex.synchronize do
    $stdout.puts(string)
  end
end

#puts_cyan(string) ⇒ Object



38
39
40
# File 'lib/blender/utils/ui.rb', line 38

def puts_cyan(string)
  puts(color(string, :cyan))
end

#puts_green(string) ⇒ Object



42
43
44
# File 'lib/blender/utils/ui.rb', line 42

def puts_green(string)
  puts(color(string, :green))
end

#puts_red(string) ⇒ Object



34
35
36
# File 'lib/blender/utils/ui.rb', line 34

def puts_red(string)
  puts(color(string, :red))
end