Class: Appear::Terminal::MacTerminal
- Inherits:
-
Service
- Object
- BaseService
- Service
- Appear::Terminal::MacTerminal
- Defined in:
- lib/appear/terminal.rb
Overview
Base class for mac terminal support
Direct Known Subclasses
Instance Method Summary collapse
-
#app_name ⇒ String
abstract
“app name” on OS X.
-
#panes ⇒ Array<#tty>
abstract
Enumerate the panes (seperate interactive sessions) that this terminal program has.
-
#reveal_pane(pane) ⇒ Object
abstract
Reveal a pane.
-
#running? ⇒ Boolean
True if the app has a running process, false otherwise.
Methods inherited from BaseService
delegate, #initialize, require_service, required_services
Constructor Details
This class inherits a constructor from Appear::BaseService
Instance Method Details
#app_name ⇒ String
subclasses must implement this method.
Returns “app name” on OS X. Both the process name of processes of this app, and the name used by Applescript to send events to this app.
46 47 48 |
# File 'lib/appear/terminal.rb', line 46 def app_name raise NotImplemented end |
#panes ⇒ Array<#tty>
subclasses must implement this method.
Enumerate the panes (seperate interactive sessions) that this terminal program has.
61 62 63 |
# File 'lib/appear/terminal.rb', line 61 def panes raise NotImplemented end |
#reveal_pane(pane) ⇒ Object
subclasses must implement this method.
Reveal a pane. Subclasses must implement this method.
69 70 71 |
# File 'lib/appear/terminal.rb', line 69 def reveal_pane(pane) raise NotImplemented end |
#running? ⇒ Boolean
Returns true if the app has a running process, false otherwise.
52 53 54 |
# File 'lib/appear/terminal.rb', line 52 def running? services.processes.pgrep(app_name).length > 0 end |