snappconfig 0.0.6 → 0.0.7

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: bc331cb53128742ecc57b70aebcb20aee74c821f
4
- data.tar.gz: 45e7934230a6c8db6d27e2a8f7a43997422a3517
3
+ metadata.gz: 14eb983b17f43b7bb6f16c65df5a8595ca02de9f
4
+ data.tar.gz: 2bd84af7c8bb5d396dd709fe79c7334140a5912d
5
5
  SHA512:
6
- metadata.gz: 53f0934447d3c2a9639dd3fe3d921ee987c63627b045b51c9d8ae6e995c35a0b09f5390df09f5375c75e8f83700257b2feb3f28c6a3bb7555146a58b7a83b78b
7
- data.tar.gz: d89e6c43f59753bcb09aea42b1049451f2d82f088597ac0177848efff29adde104a459aa7a2756a2d6050a711d2e5ef13a5f9d87c5270331d1be437c0281f5ea
6
+ metadata.gz: 1135507a51adfd8544ec0cbba1b053626253f9e2a1fffd4c2b5663287246190ff6c4af99d22be5935aca389700fe3323a55d2cc43be2c53cb121a966004b5693
7
+ data.tar.gz: 500ed4fd39889e499f93f310564913babdddb30b957a028afaa328e73f8715f60bb51f526f5e17500efc5840898548e0450d2b9a0378e09102089119520f0c06
data/README.md CHANGED
@@ -125,7 +125,7 @@ For instance, if we already have a mailer configuration that works for our app,
125
125
 
126
126
  Using the `_REQUIRED` keyword, we indicate values we expect to be included in the configuration, even though they're not in this file.
127
127
 
128
- We can then fulfill that obligation by using a git-ignored file that just stores our secrets:
128
+ We can then fill in those values with a git-ignored file that only stores our secrets:
129
129
 
130
130
  **application.secrets.yml:**
131
131
 
@@ -134,7 +134,7 @@ We can then fulfill that obligation by using a git-ignored file that just stores
134
134
  smtp_settings:
135
135
  password: 8675309
136
136
 
137
- Now we've got a complete configuration without compromising anything!
137
+ And there it is- configuration without compromise!
138
138
 
139
139
  The `_REQUIRED` keyword is really handy. You can use it to stub out an entire config file template. If any of the required values are not present at runtime Snappconfig will raise an error, ensuring you never go live without a complete configuration.
140
140
 
@@ -6,33 +6,28 @@ module Snappconfig
6
6
  class Railtie < ::Rails::Railtie
7
7
 
8
8
  config.before_configuration do
9
-
10
- is_rake_task = defined? Rake
11
- if !is_rake_task
12
9
 
13
- # Look for CONFIG file in ENV (For Heroku) or else load from file system:
14
- appconfig = ENV['CONFIG'] ? YAML.load(ENV['CONFIG']) : Snappconfig.merged_raw.deep_dup
10
+ # Look for CONFIG file in ENV (For Heroku) or else load from file system:
11
+ appconfig = ENV['CONFIG'] ? YAML.load(ENV['CONFIG']) : Snappconfig.merged_raw.deep_dup
15
12
 
16
- appconfig.deep_merge! appconfig.fetch('defaults', {})
17
- appconfig.deep_merge! appconfig.fetch(Rails.env, {})
13
+ appconfig.deep_merge! appconfig.fetch('defaults', {})
14
+ appconfig.deep_merge! appconfig.fetch(Rails.env, {})
18
15
 
19
- Snappconfig.environments.each { |environment| appconfig.delete(environment) }
16
+ Snappconfig.environments.each { |environment| appconfig.delete(environment) }
20
17
 
21
- check_required(appconfig)
18
+ check_required(appconfig)
22
19
 
23
- # Assign ENV values and then delete them from CONFIG so we don't have duplicate data:
24
- if appconfig.has_key?('ENV')
25
- appconfig['ENV'].each do |key, value|
26
- ENV[key] = value.to_s unless value.kind_of? Hash
27
- end
28
- appconfig.delete('ENV')
20
+ # Assign ENV values and then delete them from CONFIG so we don't have duplicate data:
21
+ if appconfig.has_key?('ENV')
22
+ appconfig['ENV'].each do |key, value|
23
+ ENV[key] = value.to_s unless value.kind_of? Hash
29
24
  end
30
-
31
- appconfig = recursively_symbolize_keys(appconfig)
32
- CONFIG.merge! appconfig
33
-
25
+ appconfig.delete('ENV')
34
26
  end
35
27
 
28
+ appconfig = recursively_symbolize_keys(appconfig)
29
+ CONFIG.merge! appconfig
30
+
36
31
  end
37
32
 
38
33
  rake_tasks do
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.6"
7
+ spec.version = "0.0.7"
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yarin Kessler