appcfg 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/appcfg/source.rb +11 -2
- data/spec/spec_helper.rb +2 -2
- metadata +5 -29
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/appcfg/source.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
module AppCfg
|
2
|
+
def self.set_cache data
|
3
|
+
@@cache = data
|
4
|
+
end
|
5
|
+
|
2
6
|
class Source
|
3
7
|
@@sources = []
|
4
8
|
|
@@ -29,6 +33,11 @@ module AppCfg
|
|
29
33
|
raise 'Could not match source object to any known types'
|
30
34
|
end
|
31
35
|
end
|
36
|
+
|
37
|
+
def self.clear
|
38
|
+
@@sources = []
|
39
|
+
reload_sources!
|
40
|
+
end
|
32
41
|
|
33
42
|
def self.list
|
34
43
|
@@sources
|
@@ -42,7 +51,7 @@ module AppCfg
|
|
42
51
|
cache = cache.merge(source.to_hash)
|
43
52
|
end
|
44
53
|
|
45
|
-
AppCfg.
|
54
|
+
AppCfg.set_cache hash_to_object(cache)
|
46
55
|
end
|
47
56
|
|
48
57
|
private
|
@@ -69,4 +78,4 @@ module AppCfg
|
|
69
78
|
new_hash
|
70
79
|
end
|
71
80
|
end
|
72
|
-
end
|
81
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -14,7 +14,7 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|
14
14
|
|
15
15
|
RSpec.configure do |config|
|
16
16
|
config.before(:each) do
|
17
|
-
AppCfg::Source.
|
17
|
+
AppCfg::Source.clear
|
18
18
|
@sample_env_yaml_file_path = File.expand_path(File.dirname(__FILE__) + '/support/sample_env_config.yml')
|
19
19
|
@sample_yaml_file_path = File.expand_path(File.dirname(__FILE__) + '/support/sample_config.yml')
|
20
20
|
end
|
@@ -22,4 +22,4 @@ RSpec.configure do |config|
|
|
22
22
|
config.after(:each) do
|
23
23
|
SampleConfig.reset_storage!
|
24
24
|
end
|
25
|
-
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appcfg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
version: 0.1.0
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.1
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Toms Mikoss
|
@@ -14,8 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable:
|
13
|
+
date: 2011-06-29 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: rspec
|
@@ -24,10 +19,6 @@ dependencies:
|
|
24
19
|
requirements:
|
25
20
|
- - ~>
|
26
21
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 2
|
29
|
-
- 3
|
30
|
-
- 0
|
31
22
|
version: 2.3.0
|
32
23
|
type: :development
|
33
24
|
prerelease: false
|
@@ -39,10 +30,6 @@ dependencies:
|
|
39
30
|
requirements:
|
40
31
|
- - ~>
|
41
32
|
- !ruby/object:Gem::Version
|
42
|
-
segments:
|
43
|
-
- 1
|
44
|
-
- 0
|
45
|
-
- 0
|
46
33
|
version: 1.0.0
|
47
34
|
type: :development
|
48
35
|
prerelease: false
|
@@ -54,10 +41,6 @@ dependencies:
|
|
54
41
|
requirements:
|
55
42
|
- - ~>
|
56
43
|
- !ruby/object:Gem::Version
|
57
|
-
segments:
|
58
|
-
- 1
|
59
|
-
- 5
|
60
|
-
- 2
|
61
44
|
version: 1.5.2
|
62
45
|
type: :development
|
63
46
|
prerelease: false
|
@@ -69,10 +52,6 @@ dependencies:
|
|
69
52
|
requirements:
|
70
53
|
- - ">="
|
71
54
|
- !ruby/object:Gem::Version
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
- 4
|
75
|
-
- 0
|
76
55
|
version: 0.4.0
|
77
56
|
type: :development
|
78
57
|
prerelease: false
|
@@ -108,7 +87,6 @@ files:
|
|
108
87
|
- spec/support/sample_config.yml
|
109
88
|
- spec/support/sample_env_config.yml
|
110
89
|
- spec/yaml_source_spec.rb
|
111
|
-
has_rdoc: true
|
112
90
|
homepage: http://github.com/tmikoss/appconfig
|
113
91
|
licenses:
|
114
92
|
- MIT
|
@@ -122,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
100
|
requirements:
|
123
101
|
- - ">="
|
124
102
|
- !ruby/object:Gem::Version
|
125
|
-
hash:
|
103
|
+
hash: -3676381599097783147
|
126
104
|
segments:
|
127
105
|
- 0
|
128
106
|
version: "0"
|
@@ -131,13 +109,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
109
|
requirements:
|
132
110
|
- - ">="
|
133
111
|
- !ruby/object:Gem::Version
|
134
|
-
segments:
|
135
|
-
- 0
|
136
112
|
version: "0"
|
137
113
|
requirements: []
|
138
114
|
|
139
115
|
rubyforge_project:
|
140
|
-
rubygems_version: 1.
|
116
|
+
rubygems_version: 1.7.2
|
141
117
|
signing_key:
|
142
118
|
specification_version: 3
|
143
119
|
summary: A gem for centralizing different sources of application configuration data.
|