Class: Kdeploy::Configuration
- Inherits:
-
Object
- Object
- Kdeploy::Configuration
- Defined in:
- lib/kdeploy/configuration.rb
Overview
Configuration class for managing global settings
Instance Attribute Summary collapse
-
#command_timeout ⇒ Object
Returns the value of attribute command_timeout.
-
#default_port ⇒ Object
Returns the value of attribute default_port.
-
#default_user ⇒ Object
Returns the value of attribute default_user.
-
#inventory_file ⇒ Object
Returns the value of attribute inventory_file.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#max_concurrent_tasks ⇒ Object
Returns the value of attribute max_concurrent_tasks.
-
#retry_count ⇒ Object
Returns the value of attribute retry_count.
-
#retry_delay ⇒ Object
Returns the value of attribute retry_delay.
-
#ssh_options ⇒ Object
Returns the value of attribute ssh_options.
-
#ssh_timeout ⇒ Object
Returns the value of attribute ssh_timeout.
-
#template_dir ⇒ Object
Returns the value of attribute template_dir.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#load_from_file(config_file) ⇒ void
Load configuration from YAML file.
-
#merged_ssh_options(options = {}) ⇒ Hash
Merge SSH options with defaults.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 |
# File 'lib/kdeploy/configuration.rb', line 11 def initialize set_default_values end |
Instance Attribute Details
#command_timeout ⇒ Object
Returns the value of attribute command_timeout.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def command_timeout @command_timeout end |
#default_port ⇒ Object
Returns the value of attribute default_port.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def default_port @default_port end |
#default_user ⇒ Object
Returns the value of attribute default_user.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def default_user @default_user end |
#inventory_file ⇒ Object
Returns the value of attribute inventory_file.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def inventory_file @inventory_file end |
#log_file ⇒ Object
Returns the value of attribute log_file.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def log_file @log_file end |
#log_level ⇒ Object
Returns the value of attribute log_level.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def log_level @log_level end |
#max_concurrent_tasks ⇒ Object
Returns the value of attribute max_concurrent_tasks.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def max_concurrent_tasks @max_concurrent_tasks end |
#retry_count ⇒ Object
Returns the value of attribute retry_count.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def retry_count @retry_count end |
#retry_delay ⇒ Object
Returns the value of attribute retry_delay.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def retry_delay @retry_delay end |
#ssh_options ⇒ Object
Returns the value of attribute ssh_options.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def @ssh_options end |
#ssh_timeout ⇒ Object
Returns the value of attribute ssh_timeout.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def ssh_timeout @ssh_timeout end |
#template_dir ⇒ Object
Returns the value of attribute template_dir.
6 7 8 |
# File 'lib/kdeploy/configuration.rb', line 6 def template_dir @template_dir end |
Instance Method Details
#load_from_file(config_file) ⇒ void
This method returns an undefined value.
Load configuration from YAML file
18 19 20 21 22 23 24 25 |
# File 'lib/kdeploy/configuration.rb', line 18 def load_from_file(config_file) return unless File.exist?(config_file) config = YAML.load_file(config_file) return unless config.is_a?(Hash) apply_configuration(config) end |
#merged_ssh_options(options = {}) ⇒ Hash
Merge SSH options with defaults
30 31 32 |
# File 'lib/kdeploy/configuration.rb', line 30 def ( = {}) .merge() end |