Class: Tornado::Applications::Terminal::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/applications/terminal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tab) ⇒ Tab

Returns a new instance of Tab.



42
43
44
# File 'lib/applications/terminal.rb', line 42

def initialize(tab)
  @tab = tab
end

Instance Attribute Details

#tabObject (readonly)

Returns the value of attribute tab.



40
41
42
# File 'lib/applications/terminal.rb', line 40

def tab
  @tab
end

Instance Method Details

#cd(path) ⇒ Object



63
64
65
# File 'lib/applications/terminal.rb', line 63

def cd(path)
  run "cd #{path}"
end

#clearObject



54
55
56
# File 'lib/applications/terminal.rb', line 54

def clear
  run "clear"
end

#clear_scrollbackObject



58
59
60
61
# File 'lib/applications/terminal.rb', line 58

def clear_scrollback
  @tab.selected.set(true)
  Terminal.keystroke("k", :using => :command_down)
end

#run(cmd) ⇒ Object



46
47
48
# File 'lib/applications/terminal.rb', line 46

def run(cmd)
  Terminal.do_script(cmd, :in => @tab)
end

#tail(path) ⇒ Object



50
51
52
# File 'lib/applications/terminal.rb', line 50

def tail(path)
  run "tail -f #{path}"
end