Class: OpenTerms::OsxTerminal
- Inherits:
-
Object
- Object
- OpenTerms::OsxTerminal
- Defined in:
- lib/open_terms/osx_terminal.rb
Instance Method Summary collapse
-
#initialize ⇒ OsxTerminal
constructor
A new instance of OsxTerminal.
- #open(commands) ⇒ Object
Constructor Details
#initialize ⇒ OsxTerminal
Returns a new instance of OsxTerminal.
4 5 6 7 8 9 10 |
# File 'lib/open_terms/osx_terminal.rb', line 4 def initialize require 'appscript' extend Appscript @term = app('Terminal') tab = @term.windows.first.tabs.last @set_titles = (@term.version.get.to_f < 2.1) && tab.properties.include?("custom_title") end |
Instance Method Details
#open(commands) ⇒ Object
12 13 14 15 16 |
# File 'lib/open_terms/osx_terminal.rb', line 12 def open commands run commands #set_tab_titles commands @term.windows.first.tabs.first.selected.set true end |