Class: Rutty::Runner
- Inherits:
-
Object
- Object
- Rutty::Runner
- Defined in:
- lib/rutty/runner.rb
Overview
The Rutty::Runner class includes mixins from the other modules. All end-user interaction should be done through this class.
Constant Summary
Constants included from Consts
Consts::CONF_DIR, Consts::DEFAULT_OUTPUT_FORMAT, Consts::GENERAL_CONF, Consts::GENERAL_CONF_FILE, Consts::NODES_CONF, Consts::NODES_CONF_FILE, Consts::OUTPUT_FORMATS
Instance Attribute Summary collapse
-
#config ⇒ Rutty::Config
readonly
Lazy-load the Config object for this instance, based on the config_dir param passed to #initialize.
-
#config_dir ⇒ String
The user-specified config directory, falling back to the default on nil.
-
#nodes ⇒ Rutty::Nodes
readonly
Lazy-load the Nodes object containing the user-defined nodes’ connection info.
-
#output_format ⇒ String
The tool’s output format, passed by the user via the rutty bin’s flag.
Instance Method Summary collapse
-
#initialize(config_dir = nil) ⇒ Runner
constructor
Initialize a new Runner instance.
Methods included from Actions
#add_node, #connect_to_nodes, #dsh, #generate_output, #init, #list_nodes, #scp
Methods included from Helpers
#check_installed!, get_version, #seconds_in_words
Constructor Details
#initialize(config_dir = nil) ⇒ Runner
Initialize a new Rutty::Runner instance
30 31 32 |
# File 'lib/rutty/runner.rb', line 30 def initialize config_dir = nil self.config_dir = config_dir end |
Instance Attribute Details
#config ⇒ Rutty::Config (readonly)
Lazy-load the Config object for this instance, based on the config_dir param passed to #initialize.
39 40 41 |
# File 'lib/rutty/runner.rb', line 39 def config @config end |
#config_dir ⇒ String
The user-specified config directory, falling back to the default on nil. Used by Nodes.load_config and Config.load_config to determine where to look for config files.
59 60 61 |
# File 'lib/rutty/runner.rb', line 59 def config_dir (@config_dir.nil? && Rutty::Consts::CONF_DIR) || @config_dir end |
#nodes ⇒ Rutty::Nodes (readonly)
Lazy-load the Nodes object containing the user-defined nodes’ connection info. Loads from the config_dir param passed to #initialize
48 49 50 |
# File 'lib/rutty/runner.rb', line 48 def nodes @nodes end |
#output_format ⇒ String
The tool’s output format, passed by the user via the rutty bin’s flag. Must be one of the elements of Consts::OUTPUT_FORMATS. Defaults to Consts::DEFAULT_OUTPUT_FORMAT
71 72 73 |
# File 'lib/rutty/runner.rb', line 71 def output_format @output_format end |