Class: Tlux::Commands::RunCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/tlux/commands/run_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#config_path, #setup

Constructor Details

#initialize(config_name, dir = '') ⇒ RunCommand

Returns a new instance of RunCommand.



9
10
11
12
# File 'lib/tlux/commands/run_command.rb', line 9

def initialize(config_name, dir = '')
  @config_name = config_name
  @dir = dir
end

Instance Attribute Details

#config_nameObject (readonly)

Returns the value of attribute config_name.



7
8
9
# File 'lib/tlux/commands/run_command.rb', line 7

def config_name
  @config_name
end

#dirObject (readonly)

Returns the value of attribute dir.



7
8
9
# File 'lib/tlux/commands/run_command.rb', line 7

def dir
  @dir
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/tlux/commands/run_command.rb', line 14

def run
  parser = Tlux::Config::Parser.from_file(config_file_path)
  parser.parse!

  unless dir.empty?
    parser.session.dir(dir)
  end

  exec Tlux::Config::Generator.new(parser.session).generate!
end