snappconfig 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82216d73ae7c53a02e8d0572eab2ca2e0790ca94
4
- data.tar.gz: f0980a18c83716f5e42468c02065093e73c5c68d
3
+ metadata.gz: e44533ca3098680534d2d4576f9806b7189330e7
4
+ data.tar.gz: a89a0cbbba9b0e6591603f1fca9dba1db694e954
5
5
  SHA512:
6
- metadata.gz: 77ceddc54748e10f4c3c11c56cb56921312c9b99ddded6fd70ee231710cd89ffe52817a3dca93023cecdd5f530bc11c287683b009d19ada9d8dc4b16f3b8f86d
7
- data.tar.gz: b7324b3ea3346d24967a089e3775534d2260886e7d154003819c73d5cbe32885651f31f20abe78e551e774c8443045549637e67fe83b1c6b1100e7fe0443a344
6
+ metadata.gz: b2eb6b88eb7ef1a1a212d55314d775075f17d4dd9661c1d7097056765e22625ac9bc28ea8ca1bdce96d9d09dc2f905a565121a0a99fe5f8d1fdfe69fb46165a6
7
+ data.tar.gz: c8e77806e6c2b2caa621251e7c8500deed04447cfcd35e477810a5ca23f351a308339727ee9e7c252429db7962df0b3a4bb75d285184ca346f00cb7f73ffb96d
@@ -13,6 +13,10 @@ 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
+
16
20
  check_required(appconfig)
17
21
 
18
22
  # Assign ENV values...
@@ -22,9 +26,6 @@ module Snappconfig
22
26
  end
23
27
  # ... and clear ENV values from CONFIG so we don't have duplicate data:
24
28
  appconfig.delete('ENV')
25
- appconfig.each do |key,value|
26
- value.delete('ENV') if value.is_a?(Hash) && value.has_key?('ENV')
27
- end
28
29
  end
29
30
 
30
31
  appconfig = recursively_symbolize_keys(appconfig)
data/lib/snappconfig.rb CHANGED
@@ -20,6 +20,10 @@ module Snappconfig
20
20
  end
21
21
  end
22
22
 
23
+ def environments
24
+ @environments ||= Dir.entries(Rails.root.join("config","environments").to_s).grep(/\.rb$/).map { |fname| fname.chomp!(".rb") }
25
+ end
26
+
23
27
  class ConfigFile
24
28
 
25
29
  def initialize(name)
data/snappconfig.gemspec CHANGED
@@ -4,11 +4,11 @@ $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.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["Yarin Kessler"]
9
9
  spec.email = "ykessler@appgrinders.com"
10
10
  spec.summary = %q{Smarter Rails configuration with YAML}
11
- spec.description = %q{Smarter, Heroku-friendly Rails configuration using YAML}
11
+ spec.description = %q{Smarter, Heroku-friendly Rails configuration with YAML}
12
12
  spec.homepage = "https://github.com/ykessler/snappconfig"
13
13
  spec.license = "MIT"
14
14
 
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yarin Kessler
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Smarter, Heroku-friendly Rails configuration using YAML
41
+ description: Smarter, Heroku-friendly Rails configuration with YAML
42
42
  email: ykessler@appgrinders.com
43
43
  executables: []
44
44
  extensions: []