bogo-cli 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92b58b5c767135d9451ed4230b6e4a0bdd5476a5
4
- data.tar.gz: 3d8c6aa78a970f40cf81ec487db49b33839aeb9a
3
+ metadata.gz: a77d58ef44d10c09753d741e6df3685d339a8854
4
+ data.tar.gz: c49e3cb0a4292501d3bcd3119107c5e9f9c4b260
5
5
  SHA512:
6
- metadata.gz: 4bf019f2e81b6d2315b02b970396a7a599aaf6eacc718847183bd72cfa53772fb13094c1b5e3000be633e87db09610fd311b820b8aa763ccd25969ee2263683a
7
- data.tar.gz: 05f495f97664d00e93b1953929bfacbf90caea4caff2dc37ce78745abcb9b1e448d7a766f7eeca7187ea64e915eba159a7a37ffa762e06a8ad6dc98f4ee8c2ee
6
+ metadata.gz: cdc721de56ab47a5c56233923485f776051739ed6420a3df629f6de270331690d5be9e7b40d965cbbe8d593d7cc99077636afe1d95b4923c5e3cc5285bf68b6b
7
+ data.tar.gz: ca27ba9741ce92d57569e6449729d0492f7889cbb901c2e4748783708d10a270e80d51ef533efceda1908e22f290365c5c8a862a2659266ad4f07b82ebfddce7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.4
2
+ * Prevent defaults from overwriting configuration file values (#8)
3
+ * Ensure CLI defaults have precedence over configuration class defaults (#8)
4
+
1
5
  # v0.2.2
2
6
  * Process CLI values prior to configuration merge (#7)
3
7
 
@@ -93,8 +93,26 @@ module Bogo
93
93
  end
94
94
  if(config_inst)
95
95
  options.delete(:config)
96
- defaults_inst = config_class.new(defaults.to_smash)
97
- options_inst = config_class.new(options.to_smash)
96
+ defaults_inst = Smash[
97
+ config_class.new(
98
+ defaults.to_smash
99
+ ).to_smash.find_all do |key, value|
100
+ defaults.key?(key)
101
+ end
102
+ ]
103
+ config_data = config_inst.load!
104
+ config_inst = Smash[
105
+ config_inst.to_smash.find_all do |key, value|
106
+ config_data.key?(key)
107
+ end
108
+ ]
109
+ options_inst = Smash[
110
+ config_class.new(
111
+ options.to_smash
112
+ ).to_smash.find_all do |key, value|
113
+ options.key?(key)
114
+ end
115
+ ]
98
116
  @options = config_class.new(
99
117
  defaults_inst.to_smash.deep_merge(
100
118
  config_inst.to_smash.deep_merge(
@@ -1,6 +1,6 @@
1
1
  module Bogo
2
2
  module Cli
3
3
  # Current library version
4
- VERSION = Gem::Version.new('0.2.2')
4
+ VERSION = Gem::Version.new('0.2.4')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-19 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo