chamber 0.0.2 → 0.0.3

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: 06481d8263ba75487270bf6bc366357d8ea45e81
4
- data.tar.gz: 7095ff800b808dae4ba3470fca3cdcab26072ec1
3
+ metadata.gz: c3d0623953d3ea2cce94def03a7f2fd8415b4e17
4
+ data.tar.gz: 23c1aff1d806a8435f86fa0c65f58148a18b8a9d
5
5
  SHA512:
6
- metadata.gz: 5d2971516f0228a5fc17ce2b29375b5fb6fd7475918c9ad6df934727b0e15f7176979e16ce93cb9201cf8b69123485186673d0adcdb000680efb665de5298b0e
7
- data.tar.gz: 6f38b25d90ade7a0ddc3a07ecb00a069d4f078994f8edab98567434a48767b6459c2079679132df941528252b50208f4b590fdec3d6c3422aa09e0f1a9721f91
6
+ metadata.gz: affc2e58f699e7a2f0e9bda2832cf9008e391bedebc08f6bf6e3a67703f77d64e26edccd1696afb60da3b7a89fece1082959c5dc5f9aec86e4d414456cf8f024
7
+ data.tar.gz: 76c9017cb04679780123916532508a1fed799b57f37a06385386108129a95d66115b06af1f690ed6124b9475fa941f97325160cf518c4120edc17b04fd2bd4ae
data/README.md CHANGED
@@ -73,6 +73,21 @@ class Settings
73
73
 
74
74
  source Rails.root.join('config', 'settings.yml'), namespace: Rails.env, override_from_environment: true
75
75
  source Rails.root.join('config', "credentials-#{Rails.env}.yml")
76
+
77
+ load!
78
+ end
79
+ ```
80
+
81
+ Finally, after all your `source` calls, you must call `load!`:
82
+
83
+ ```ruby
84
+ class Settings
85
+ extend Chamber
86
+
87
+ source Rails.root.join('config', 'settings.yml'), namespace: Rails.env, override_from_environment: true
88
+ source Rails.root.join('config', "credentials-#{Rails.env}.yml")
89
+
90
+ load!
76
91
  end
77
92
  ```
78
93
 
@@ -115,7 +130,7 @@ inherently wrong with storing sensitive information in git. You just wouldn't
115
130
  want to store it in a public repository.
116
131
 
117
132
  If it weren't for this concern, managing settings would be trivial, easily
118
- solved use any number of approaches (e.g., [like using YAML and ERB in an
133
+ solved use any number of approaches; e.g., [like using YAML and ERB in an
119
134
  initializer](http://urgetopunt.com/rails/2009/09/12/yaml-config-with-erb.html).
120
135
 
121
136
  I recommend adding a pattern like this to `.gitignore`:
@@ -35,6 +35,8 @@ module Chamber
35
35
  @chamber_instance ||= Hashie::Mash.new
36
36
  end
37
37
 
38
+ alias_method :env, :instance
39
+
38
40
  private
39
41
 
40
42
  def assert_valid_keys(options)
@@ -1,3 +1,3 @@
1
1
  module Chamber
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -221,4 +221,10 @@ MODIFIED
221
221
  expect(Settings.instance).to be_a(Hashie::Mash)
222
222
  end
223
223
  end
224
+
225
+ describe '.env' do
226
+ it 'is aliased to :instance' do
227
+ expect(Settings.method(:env)).to eq Settings.method(:instance)
228
+ end
229
+ end
224
230
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chamber
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
  - stevenhallen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-15 00:00:00.000000000 Z
12
+ date: 2013-11-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.0.3
128
+ rubygems_version: 2.0.6
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Heroku-friendly Settings