econfig 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/econfig/configuration.rb +1 -1
- data/lib/econfig/version.rb +1 -1
- data/spec/configuration_spec.rb +10 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d86ec0882346b8c6b8008617d48044cc1b2f687
|
4
|
+
data.tar.gz: cfb35e4269f57f3d26a35d873b957b996ef8ec7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f09880fbdd95b344b4341a0cdb434ac6fc3b7256b617f15f47ebe616eb9a6a358470b1b2911bf94ecb6e2d33e59e49a1d8573b12b722417a1438c4dfdb4c99
|
7
|
+
data.tar.gz: c0cabef2e2d453280d1d2c797dccfebfc5087dcbfcbf3264c7b6d5986ce405eb460d13479ed1b4b07995e46bc347d71d4680f3fc23811bfd256b3a821a751a02
|
@@ -21,7 +21,7 @@ module Econfig
|
|
21
21
|
def []=(backend_name = default_write_backend, key, value)
|
22
22
|
raise ArgumentError, "no backend given" unless backend_name
|
23
23
|
if backend = backends[backend_name]
|
24
|
-
backend.set(key, value)
|
24
|
+
backend.set(key.to_s, value)
|
25
25
|
else
|
26
26
|
raise KeyError, "#{backend_name} is not set"
|
27
27
|
end
|
data/lib/econfig/version.rb
CHANGED
data/spec/configuration_spec.rb
CHANGED
@@ -14,6 +14,11 @@ describe Econfig::Configuration do
|
|
14
14
|
config["foobar"].should == "elephant"
|
15
15
|
end
|
16
16
|
|
17
|
+
it "casts key to string" do
|
18
|
+
backend.stub(:get).with("foobar").and_return("elephant")
|
19
|
+
config[:foobar].should == "elephant"
|
20
|
+
end
|
21
|
+
|
17
22
|
it "tries multiple backends until it finds a response" do
|
18
23
|
backend.stub(:get).with("foobar").and_return(nil)
|
19
24
|
other_backend.stub(:get).with("foobar").and_return("elephant")
|
@@ -33,6 +38,11 @@ describe Econfig::Configuration do
|
|
33
38
|
config[:one, "foobar"] = "elephant"
|
34
39
|
end
|
35
40
|
|
41
|
+
it "casts keys to string" do
|
42
|
+
backend.should_receive(:set).with("foobar", "elephant")
|
43
|
+
config[:one, :foobar] = "elephant"
|
44
|
+
end
|
45
|
+
|
36
46
|
it "sets response on default backend if default backend is set" do
|
37
47
|
config.default_write_backend = :other
|
38
48
|
other_backend.should_receive(:set).with("foobar", "elephant")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: econfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.2.
|
144
|
+
rubygems_version: 2.2.1
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Congifure Ruby apps
|
@@ -156,4 +156,3 @@ test_files:
|
|
156
156
|
- spec/shortcut_spec.rb
|
157
157
|
- spec/spec_helper.rb
|
158
158
|
- spec/yaml_spec.rb
|
159
|
-
has_rdoc:
|