Class: Mysqlknife::Iterm
- Inherits:
-
Object
- Object
- Mysqlknife::Iterm
- Defined in:
- lib/mysqlknife/iterm.rb
Instance Method Summary collapse
- #color(name) ⇒ Object
-
#initialize ⇒ Iterm
constructor
A new instance of Iterm.
- #name(name = nil) ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Iterm
Returns a new instance of Iterm.
5 6 7 8 9 |
# File 'lib/mysqlknife/iterm.rb', line 5 def initialize @color = { orange: [255,128,000], green: [000,255,000], red: [255,000,000] } end |
Instance Method Details
#color(name) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mysqlknife/iterm.rb', line 15 def color(name) name = name.to_sym red = @color[name][0] green = @color[name][1] blue = @color[name][2] print "\033]6;1;bg;red;brightness;#{red}\a" print "\033]6;1;bg;green;brightness;#{green}\a" print "\033]6;1;bg;blue;brightness;#{blue}\a" end |
#name(name = nil) ⇒ Object
11 12 13 |
# File 'lib/mysqlknife/iterm.rb', line 11 def name(name = nil) print "\033]0;#{name}\007" end |
#reset ⇒ Object
26 27 28 |
# File 'lib/mysqlknife/iterm.rb', line 26 def reset print "\033]6;1;bg;*;default\a" end |