Class: PolarBear::Command::Config
- Inherits:
-
Object
- Object
- PolarBear::Command::Config
- Defined in:
- lib/polarbear/command/config.rb
Overview
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #load_from_local_settings ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 |
# File 'lib/polarbear/command/config.rb', line 10 def initialize end |
Instance Method Details
#load_from_local_settings ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/polarbear/command/config.rb', line 13 def load_from_local_settings config_data = Utils::Executor.instance.execute_command('set') hash = {} config_data.each_line { |l| updated_line = l.gsub(/\s+/, '').chomp regex = /(([^=;]*)=([^=;]*);?)+/ match = updated_line.match regex if !match.nil? && !match[3].empty? && match[3] != '(Empty)' hash[match[2]] = match[3] end } hash end |