Class: Tlux::Commands::OpenCommand
- Defined in:
- lib/tlux/commands/open_command.rb
Instance Attribute Summary collapse
-
#config_name ⇒ Object
readonly
Returns the value of attribute config_name.
Instance Method Summary collapse
-
#initialize(config_name) ⇒ OpenCommand
constructor
A new instance of OpenCommand.
- #run(open_editor = true) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(config_name) ⇒ OpenCommand
Returns a new instance of OpenCommand.
6 7 8 |
# File 'lib/tlux/commands/open_command.rb', line 6 def initialize(config_name) @config_name = config_name end |
Instance Attribute Details
#config_name ⇒ Object (readonly)
Returns the value of attribute config_name.
4 5 6 |
# File 'lib/tlux/commands/open_command.rb', line 4 def config_name @config_name end |
Instance Method Details
#run(open_editor = true) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/tlux/commands/open_command.rb', line 10 def run(open_editor = true) setup create_config unless File.exists?(config_file_path) raise Tlux::EditorNotDefinedError unless editor exec "#{editor} #{config_file_path}" if open_editor end |