Class: Kleiber::Terminal
- Inherits:
-
Object
- Object
- Kleiber::Terminal
- Defined in:
- lib/kleiber/terminal.rb
Overview
Class Terminal provides api for current terminal
Instance Attribute Summary collapse
-
#exec ⇒ Object
readonly
Returns the value of attribute exec.
-
#exec_command ⇒ Object
readonly
Returns the value of attribute exec_command.
-
#new_tab ⇒ Object
readonly
Returns the value of attribute new_tab.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#execute(scriptfile) ⇒ Object
Runs command line in new tab.
-
#initialize(settings) ⇒ Terminal
constructor
A new instance of Terminal.
Constructor Details
#initialize(settings) ⇒ Terminal
Returns a new instance of Terminal.
8 9 10 11 12 13 |
# File 'lib/kleiber/terminal.rb', line 8 def initialize(settings) @exec = settings[:exec] @new_tab = settings[:new_tab] @title = settings[:title] @exec_command = settings[:exec_command] end |
Instance Attribute Details
#exec ⇒ Object (readonly)
Returns the value of attribute exec.
7 8 9 |
# File 'lib/kleiber/terminal.rb', line 7 def exec @exec end |
#exec_command ⇒ Object (readonly)
Returns the value of attribute exec_command.
7 8 9 |
# File 'lib/kleiber/terminal.rb', line 7 def exec_command @exec_command end |
#new_tab ⇒ Object (readonly)
Returns the value of attribute new_tab.
7 8 9 |
# File 'lib/kleiber/terminal.rb', line 7 def new_tab @new_tab end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
7 8 9 |
# File 'lib/kleiber/terminal.rb', line 7 def title @title end |
Instance Method Details
#execute(scriptfile) ⇒ Object
Runs command line in new tab
17 18 19 20 |
# File 'lib/kleiber/terminal.rb', line 17 def execute(scriptfile) puts command_line.command(script: scriptfile.path) command_line.run(script: scriptfile.path) end |