Class: Tornado::Applications::Terminal::Tab
- Inherits:
-
Object
- Object
- Tornado::Applications::Terminal::Tab
- Defined in:
- lib/applications/terminal.rb
Instance Attribute Summary collapse
-
#tab ⇒ Object
readonly
Returns the value of attribute tab.
Instance Method Summary collapse
- #cd(path) ⇒ Object
- #clear ⇒ Object
- #clear_scrollback ⇒ Object
-
#initialize(tab) ⇒ Tab
constructor
A new instance of Tab.
- #run(cmd) ⇒ Object
- #tail(path) ⇒ Object
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
#tab ⇒ Object (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 |
#clear ⇒ Object
54 55 56 |
# File 'lib/applications/terminal.rb', line 54 def clear run "clear" end |
#clear_scrollback ⇒ Object
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 |