chamber 0.0.3 → 0.0.4

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: c3d0623953d3ea2cce94def03a7f2fd8415b4e17
4
- data.tar.gz: 23c1aff1d806a8435f86fa0c65f58148a18b8a9d
3
+ metadata.gz: bdabeaa7f46f79f6e320ab4124bf84c971e83533
4
+ data.tar.gz: 83de25cdc6048fdc681b0a69ed10a7b312a96637
5
5
  SHA512:
6
- metadata.gz: affc2e58f699e7a2f0e9bda2832cf9008e391bedebc08f6bf6e3a67703f77d64e26edccd1696afb60da3b7a89fece1082959c5dc5f9aec86e4d414456cf8f024
7
- data.tar.gz: 76c9017cb04679780123916532508a1fed799b57f37a06385386108129a95d66115b06af1f690ed6124b9475fa941f97325160cf518c4120edc17b04fd2bd4ae
6
+ metadata.gz: 3cbf0a8825b0a40e6743effce5322db8ae5842e74c7454e39de340d8dad07338ce6970b3b07e0ef4b313aa97585da4ce1b2ee6cc5315a02293433d7ff76c0530
7
+ data.tar.gz: 64998ca0ddad139b1a9127be272da8beb09f53726c902858c822ea15f50345ba9dafe19d701703bbedf1fc2fffb1263c76732879ddf32206b3f6e00cc8d08594
data/README.md CHANGED
@@ -94,8 +94,8 @@ end
94
94
  Use `heroku config` to set the `ENV_VAR_NAME` value for the staging and
95
95
  production remotes.
96
96
 
97
- Now you can access your settings in your code from `Settings.instance` (assuming
98
- you extended Chamber in a class named `Settings`).
97
+ Now you can access your settings in your code as properties of your `Settings`
98
+ class (assuming you extended Chamber in a class named `Settings`).
99
99
 
100
100
  In other words, given a configuration file like this:
101
101
 
@@ -112,10 +112,10 @@ the corresponding Paperclip configuration would look like this:
112
112
  Paperclip::Attachment.default_options.merge!(
113
113
  storage: 's3',
114
114
  s3_credentials: {
115
- access_key_id: Settings.instance.s3.access_key_id,
116
- secret_access_key: Settings.instance.s3.secret_access_key
115
+ access_key_id: Settings.s3.access_key_id,
116
+ secret_access_key: Settings.s3.secret_access_key
117
117
  },
118
- bucket: Settings.instance.s3.bucket,
118
+ bucket: Settings.s3.bucket,
119
119
  ...
120
120
  ```
121
121
 
@@ -30,4 +30,7 @@ CHAMBER
30
30
  spec.add_development_dependency "rake"
31
31
  spec.add_development_dependency "rspec", "~> 2.14"
32
32
  spec.add_development_dependency "simplecov", "~> 0.7"
33
+
34
+ spec.add_development_dependency "pry"
35
+
33
36
  end
@@ -35,6 +35,10 @@ module Chamber
35
35
  @chamber_instance ||= Hashie::Mash.new
36
36
  end
37
37
 
38
+ def method_missing(method_name, *args, &block)
39
+ instance.public_send(method_name, *args, &block)
40
+ end
41
+
38
42
  alias_method :env, :instance
39
43
 
40
44
  private
@@ -1,3 +1,3 @@
1
1
  module Chamber
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -130,6 +130,11 @@ CONTENT
130
130
  Settings.load!
131
131
  expect(Settings.instance.to_hash).to eq expected
132
132
  end
133
+
134
+ it 'provides access to all settings without the instance root' do
135
+ Settings.load!
136
+ expect(Settings.to_hash).to eq expected
137
+ end
133
138
  end
134
139
 
135
140
  context 'and the :namespace option is specified' do
@@ -147,6 +152,11 @@ CONTENT
147
152
  Settings.load!
148
153
  expect(Settings.instance.to_hash).to eq expected
149
154
  end
155
+
156
+ it 'provides access to all settings without the instance root' do
157
+ Settings.load!
158
+ expect(Settings.to_hash).to eq expected
159
+ end
150
160
  end
151
161
 
152
162
  context 'and it is not valid' do
@@ -168,6 +178,11 @@ CONTENT
168
178
  Settings.load!
169
179
  expect(Settings.instance.secret).to eq 'value'
170
180
  end
181
+
182
+ it 'provides access to all settings without the instance root' do
183
+ Settings.load!
184
+ expect(Settings.secret).to eq 'value'
185
+ end
171
186
  end
172
187
 
173
188
  context 'and the environment variable is not present' do
@@ -177,6 +192,11 @@ CONTENT
177
192
  Settings.load!
178
193
  expect(Settings.instance.secret).to be_nil
179
194
  end
195
+
196
+ it 'provides acccess to all settings without the instance root' do
197
+ Settings.load!
198
+ expect(Settings.secret).to be_nil
199
+ end
180
200
  end
181
201
  end
182
202
  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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - stevenhallen
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - ~>
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0.7'
84
+ - !ruby/object:Gem::Dependency
85
+ name: pry
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
84
98
  description: |
85
99
  Chamber lets you source your Settings from an arbitrary number
86
100
  of YAML files and provides a simple mechanism for overriding