Class: Mysqlknife::Iterm

Inherits:
Object
  • Object
show all
Defined in:
lib/mysqlknife/iterm.rb

Instance Method Summary collapse

Constructor Details

#initializeIterm

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

#resetObject



26
27
28
# File 'lib/mysqlknife/iterm.rb', line 26

def reset
  print "\033]6;1;bg;*;default\a"
end