configer 1.2.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/configer/json.rb +1 -1
- data/lib/configer/object.rb +1 -0
- data/lib/configer/support.rb +17 -7
- data/lib/configer/yaml.rb +1 -1
- data/pmip/pmip.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b78da41fd3a5fca93fb45ecca03a556ad463df4
|
4
|
+
data.tar.gz: a8b166b52c809addb0ede7a60a2ac19a7b5d0a6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dc09b115d153361217a2eb2d3d06a7447859be9d8a2b727fd5c7221305bbe757ad4bdcbc4cbcd3ca166a2e6e77e76a21c9c77f61142ba97887c747a9de4d125
|
7
|
+
data.tar.gz: 2f281faef0050d5b60e5b1a9a0274a7c33bfc3fb4d857e963e39b22fd5e63fe97e36e8b3bf41f6c7d1b7895f931e6c1b04c58160bfdda463c25cff9c67d68c9c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/lib/configer/json.rb
CHANGED
@@ -10,7 +10,7 @@ module Configer
|
|
10
10
|
[:r,:folder,:dir,:directory].each do |sym|
|
11
11
|
opts[:root] ||= opts.delete(sym)
|
12
12
|
end
|
13
|
-
opts[:root] ||=
|
13
|
+
opts[:root] ||= Configer.pwd
|
14
14
|
|
15
15
|
opts[:out] ||= opts.delete(:o) || opts.delete(:to) || Configer::Object
|
16
16
|
raise(ArgumentError,"out/to must point to hashlike object") unless opts[:out].class <= ::Hash
|
data/lib/configer/object.rb
CHANGED
data/lib/configer/support.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
module Configer
|
2
2
|
|
3
|
+
def self.pwd
|
4
|
+
|
5
|
+
if defined?(Rails) && !(Rails.root.nil?)
|
6
|
+
return Rails.root.to_s
|
7
|
+
else
|
8
|
+
return Dir.pwd.to_s
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
3
13
|
module Support
|
4
14
|
|
5
15
|
#> return mounted config objects
|
@@ -35,18 +45,18 @@ module Configer
|
|
35
45
|
end
|
36
46
|
|
37
47
|
#> load lib meta folders files
|
38
|
-
if File.exist?(File.join(
|
39
|
-
config_yaml_paths.push_paths *Dir.glob(File.join(
|
40
|
-
config_yaml_paths.push_paths *Dir.glob(File.join(
|
48
|
+
if File.exist?(File.join(Configer.pwd,'lib'))
|
49
|
+
config_yaml_paths.push_paths *Dir.glob(File.join(Configer.pwd,'lib','**','{meta,META}','*.{yaml,yml,json}'))
|
50
|
+
config_yaml_paths.push_paths *Dir.glob(File.join(Configer.pwd,'lib','{meta,META}','**','*.{yaml,yml,json}'))
|
41
51
|
config_yaml_paths.compact!
|
42
52
|
end
|
43
53
|
|
44
54
|
#> load config folder
|
45
|
-
if File.exist?(File.join(
|
55
|
+
if File.exist?(File.join(Configer.pwd,'config'))
|
46
56
|
|
47
|
-
config_yaml_paths.push_paths *Dir.glob(File.join(
|
48
|
-
if File.exist?(File.join(
|
49
|
-
config_yaml_paths.push_paths *Dir.glob(File.join(
|
57
|
+
config_yaml_paths.push_paths *Dir.glob(File.join(Configer.pwd,'config','*.{yaml,yml,json}'))
|
58
|
+
if File.exist?(File.join(Configer.pwd,'config','environments'))
|
59
|
+
config_yaml_paths.push_paths *Dir.glob(File.join(Configer.pwd,'config','environments','*.{yaml,yml,json}'))
|
50
60
|
end
|
51
61
|
config_yaml_paths.compact!
|
52
62
|
|
data/lib/configer/yaml.rb
CHANGED
@@ -10,7 +10,7 @@ module Configer
|
|
10
10
|
[:r,:folder,:dir,:directory].each do |sym|
|
11
11
|
opts[:root] ||= opts.delete(sym)
|
12
12
|
end
|
13
|
-
opts[:root] ||=
|
13
|
+
opts[:root] ||= Configer.pwd
|
14
14
|
|
15
15
|
opts[:out] ||= opts.delete(:o) || opts.delete(:to) || Configer::Object
|
16
16
|
raise(ArgumentError,"out/to must point to hashlike object") unless opts[:out].class <= ::Hash
|
data/pmip/pmip.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
puts 'Hello PMIP 0.3.2! - Please see http://code.google.com/p/pmip/ for full instructions and plugin helper bundles.'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/configer/object.rb
|
64
64
|
- lib/configer/support.rb
|
65
65
|
- lib/configer/yaml.rb
|
66
|
+
- pmip/pmip.rb
|
66
67
|
- sample/load_meta_files.rb
|
67
68
|
- sample/meta/hello.json
|
68
69
|
- sample/meta/test.yml
|