Class: Configuration
- Inherits:
-
Object
- Object
- Configuration
- Defined in:
- lib/gem_release/configuration.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
- #conf_path ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load_options! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 |
# File 'lib/gem_release/configuration.rb', line 8 def initialize end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/gem_release/configuration.rb', line 6 def end |
Instance Method Details
#[](key) ⇒ Object
30 31 32 |
# File 'lib/gem_release/configuration.rb', line 30 def [](key) [key] end |
#[]=(key, val) ⇒ Object
26 27 28 |
# File 'lib/gem_release/configuration.rb', line 26 def []=(key,val) [key] = val end |
#conf_path ⇒ Object
22 23 24 |
# File 'lib/gem_release/configuration.rb', line 22 def conf_path File.(Dir.glob('**/.gemrelease').first.to_s) end |
#load_options! ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/gem_release/configuration.rb', line 12 def = Hash.new { |hash, key| hash[key] = {} } if File.exist?(conf_path.to_s) && !File.directory?(conf_path.to_s) config_hash = YAML.load(File.read(conf_path)) if config_hash .merge!(config_hash.deep_symbolize_keys!) end end end |