Class: Wasko::Iterm

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

Overview

Adds support for [iTerm2](code.google.com/p/iterm2/)

Class Method Summary collapse

Class Method Details

.bold_text_colorObject



17
18
19
# File 'lib/wasko/iterm.rb', line 17

def self.bold_text_color
  bold_color
end

.font_nameObject



9
10
11
# File 'lib/wasko/iterm.rb', line 9

def self.font_name
  'Not supported'
end

.font_sizeObject



13
14
15
# File 'lib/wasko/iterm.rb', line 13

def self.font_size
  'Not supported'
end

.method_missing(method_sym, *arguments, &block) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/wasko/iterm.rb', line 38

def self.method_missing(method_sym, *arguments, &block)
  if method_sym.to_s =~ /^set_(.*)$/
    self.set($1.gsub(/_/, " ") => arguments.first)
  elsif method_sym.to_s =~ /^([a-z]+_[a-z]+(.*))$/
    self.get($1.gsub(/_/, " "))
  else
    super
  end
end

.normal_text_colorObject



5
6
7
# File 'lib/wasko/iterm.rb', line 5

def self.normal_text_color
  foreground_color
end

.respond_to?(method_sym, include_private = false) ⇒ Boolean

Pretty big todo, shield this off somewhat.

Returns:

  • (Boolean)


49
50
51
52
53
54
55
56
57
# File 'lib/wasko/iterm.rb', line 49

def self.respond_to?(method_sym, include_private = false)
  if method_sym.to_s =~ /^set_(.*)$/
    true
  elsif method_sym.to_s =~ /^[a-z]+_[a-z]+(.*)$/
    true
  else
    super
  end
end

.set_bold_text_color(color) ⇒ Object



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

def self.set_bold_text_color(color)
  set_bold_color color
end

.set_normal_text_color(color) ⇒ Object

Terminal.app uses a slightly different terminology



22
23
24
# File 'lib/wasko/iterm.rb', line 22

def self.set_normal_text_color(color)
  set_foreground_color color
end

.startup_background_colorObject

iTerm doesn’t have a way to get back the original color, falling back to black for now.

Returns an applescript color



34
35
36
# File 'lib/wasko/iterm.rb', line 34

def self.startup_background_color
  "{0,0,0}"
end