constantinople 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/constantinople.rb +3 -4
- data/lib/constantinople/version.rb +1 -1
- metadata +3 -3
data/lib/constantinople.rb
CHANGED
@@ -11,21 +11,20 @@ module Constantinople
|
|
11
11
|
caller_config_directories do |dir|
|
12
12
|
result.deeper_merge!(load_from_directory(dir))
|
13
13
|
end
|
14
|
-
env = environment
|
15
|
-
result.each do |key, value|
|
16
|
-
value.deeper_merge!(value[env]) if value.include?(env)
|
17
|
-
end
|
18
14
|
result # I'm the map, I'm the map, I'm the map, I'm the map...
|
19
15
|
end
|
20
16
|
|
21
17
|
private
|
22
18
|
|
23
19
|
def self.load_from_directory(dir)
|
20
|
+
env = environment
|
24
21
|
result = Map.new
|
25
22
|
['.yml.default', '.yml', '.yml.override'].each do |ext|
|
26
23
|
Dir.glob(File.join(dir,"*#{ext}")) do |path|
|
27
24
|
filename = File.basename(path,ext)
|
28
25
|
result.deeper_merge!(filename => YAML.load_file(path))
|
26
|
+
sub = result[filename]
|
27
|
+
sub.deeper_merge!(sub[env]) if sub.include?(env)
|
29
28
|
end
|
30
29
|
end
|
31
30
|
result
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constantinople
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.5
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Johnson
|