snappconfig 0.0.2 → 0.0.3

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: e44533ca3098680534d2d4576f9806b7189330e7
4
- data.tar.gz: a89a0cbbba9b0e6591603f1fca9dba1db694e954
3
+ metadata.gz: 625e64ac4dd886d0d6d599a022df0ad493ab15ea
4
+ data.tar.gz: fc9b9b96c0fe406a7eb6abf343cc86840a61e0f0
5
5
  SHA512:
6
- metadata.gz: b2eb6b88eb7ef1a1a212d55314d775075f17d4dd9661c1d7097056765e22625ac9bc28ea8ca1bdce96d9d09dc2f905a565121a0a99fe5f8d1fdfe69fb46165a6
7
- data.tar.gz: c8e77806e6c2b2caa621251e7c8500deed04447cfcd35e477810a5ca23f351a308339727ee9e7c252429db7962df0b3a4bb75d285184ca346f00cb7f73ffb96d
6
+ metadata.gz: 094c0c42ee8a95efe4f3946ae1bb4e851e458103078739085acfaa35ffb37b4674115f089abc72ad33a96681f8283c4fa33567686319eae07a2cd9a208f0006e
7
+ data.tar.gz: 92a2be72ad3bea65694c2656d20636f12b27a11a8a23f3fffb909fc4bb42fde9a73292b4247d5929ac54c432b6711b6963619f1bb8e52e8220ef51ecbcb01f90
@@ -13,10 +13,6 @@ module Snappconfig
13
13
  appconfig.deep_merge! appconfig.fetch('defaults', {})
14
14
  appconfig.deep_merge! appconfig.fetch(Rails.env, {})
15
15
 
16
- Snappconfig.environments.each do |environment|
17
- appconfig.delete(environment)
18
- end
19
-
20
16
  check_required(appconfig)
21
17
 
22
18
  # Assign ENV values...
@@ -26,6 +22,9 @@ module Snappconfig
26
22
  end
27
23
  # ... and clear ENV values from CONFIG so we don't have duplicate data:
28
24
  appconfig.delete('ENV')
25
+ appconfig.each do |key,value|
26
+ value.delete('ENV') if value.is_a?(Hash) && value.has_key?('ENV')
27
+ end
29
28
  end
30
29
 
31
30
  appconfig = recursively_symbolize_keys(appconfig)
@@ -40,7 +39,13 @@ module Snappconfig
40
39
  private
41
40
 
42
41
  def check_required(hash)
43
- hash.each_pair do |key,value|
42
+
43
+ env_hash = hash.clone
44
+ Snappconfig.environments.each do |environment|
45
+ env_hash.delete(environment)
46
+ end
47
+
48
+ env_hash.each_pair do |key,value|
44
49
  if value == '_REQUIRED'
45
50
  raise "The configuration value #{key} is required but was not supplied. Check your application.yml file(s)."
46
51
  elsif value.is_a?(Hash)
data/snappconfig.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "snappconfig"
7
- spec.version = "0.0.2"
7
+ spec.version = "0.0.3"
8
8
  spec.authors = ["Yarin Kessler"]
9
9
  spec.email = "ykessler@appgrinders.com"
10
10
  spec.summary = %q{Smarter Rails configuration with YAML}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snappconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yarin Kessler