configured 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +7 -0
- data/lib/configured/settings.rb +1 -1
- data/lib/configured/version.rb +1 -1
- data/spec/settings_spec.rb +6 -1
- data/spec/spec_helper.rb +0 -8
- metadata +4 -3
data/Rakefile
ADDED
data/lib/configured/settings.rb
CHANGED
@@ -8,7 +8,7 @@ module Configured
|
|
8
8
|
# Get settings for the required environment.
|
9
9
|
def for_the(environment)
|
10
10
|
begin
|
11
|
-
settings = @configuration_data[environment] || raise
|
11
|
+
settings = @configuration_data[environment.to_s] || raise
|
12
12
|
|
13
13
|
settings_hash = {}
|
14
14
|
settings.each_key { |key| settings_hash[key.intern] = settings[key]}
|
data/lib/configured/version.rb
CHANGED
data/spec/settings_spec.rb
CHANGED
@@ -16,8 +16,13 @@ module Configured
|
|
16
16
|
ret = Settings.new(@configuration_fake).for_the("test")
|
17
17
|
ret.should == {:setting => "value", :setting2 => "value2"}
|
18
18
|
end
|
19
|
+
|
20
|
+
it "should return settings when environment name passed as symbol just like if environment name passed as string" do
|
21
|
+
ret = Settings.new(@configuration_fake).for_the(:test)
|
22
|
+
ret.should == {:setting => "value", :setting2 => "value2"}
|
23
|
+
end
|
19
24
|
|
20
|
-
it "should raise expception if there is no such environment in config" do
|
25
|
+
it "should raise an expception if there is no such environment in config" do
|
21
26
|
lambda {Settings.new(@configuration_fake).for_the("bad-entry")}.should raise_error
|
22
27
|
end
|
23
28
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,12 +4,4 @@ require 'yaml'
|
|
4
4
|
configured_src = '../../lib/configured'
|
5
5
|
require File.expand_path(configured_src, __FILE__)
|
6
6
|
|
7
|
-
# Rspec settings
|
8
|
-
#RSpec.configure do |config|
|
9
|
-
# config.mock_with :mocha
|
10
|
-
# config.mock_with :flexmock
|
11
|
-
# config.mock_with :rr
|
12
|
-
# config.mock_with :rspec
|
13
|
-
#end
|
14
|
-
|
15
7
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configured
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-10-06 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: configured. Use your database.yaml in rails initters. For redis, redis-store
|
15
15
|
and e.t.c.
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- spec/settings_spec.rb
|
27
27
|
- spec/spec_helper.rb
|
28
28
|
- README.md
|
29
|
+
- Rakefile
|
29
30
|
homepage: https://github.com/nettsundere/configured
|
30
31
|
licenses: []
|
31
32
|
post_install_message:
|
@@ -49,5 +50,5 @@ rubyforge_project:
|
|
49
50
|
rubygems_version: 1.8.10
|
50
51
|
signing_key:
|
51
52
|
specification_version: 3
|
52
|
-
summary: configured 1.0.
|
53
|
+
summary: configured 1.0.4
|
53
54
|
test_files: []
|