Class: WorkOn::AbstractTerminal

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/work_on/terminal.rb

Overview

Base class for Terminals only tabs allow for command execution So the idea is that you only call execute on a tab

This means that every window should have at least 1 tab (even though it will not be visible gui-wise)

Direct Known Subclasses

MacTerminal

Defined Under Namespace

Classes: Tab, Window

Instance Method Summary collapse

Instance Method Details

#execute(cmd) ⇒ Object



85
86
87
# File 'lib/work_on/terminal.rb', line 85

def execute(cmd)
  selected_tab.execute(cmd)
end

#new_windowObject



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

def new_window
  not_implemented
end

#selected_tabObject

it is possible to overwrite this method if you feel the speed boost is necessary



68
69
70
# File 'lib/work_on/terminal.rb', line 68

def selected_tab
  selected_window.selected_tab
end

#selected_windowObject

it is possible to overwrite this method if you feel the speed boost is necessary



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

def selected_window
  windows.find {|w| w.selected?}
end

#windowsObject



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

def windows
  not_implemented
end