configulations 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,9 +1,12 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ gem "json_pure", :platform => :jruby
4
+ gem "json", :platform => :ruby_18
5
+
3
6
  group :development do
4
7
  gem "rspec", "~> 2.3.0"
5
8
  gem "bundler", "~> 1.0.0"
6
9
  gem "jeweler", "~> 1.6.2"
7
10
  gem "rcov", ">= 0"
8
- gem "ruby-debug19"
11
+ gem "ruby-debug19", :platforms => :mri_19
9
12
  end
data/Gemfile.lock CHANGED
@@ -9,10 +9,13 @@ GEM
9
9
  bundler (~> 1.0)
10
10
  git (>= 1.2.5)
11
11
  rake
12
+ json (1.5.3)
13
+ json_pure (1.5.3)
12
14
  linecache19 (0.5.12)
13
15
  ruby_core_source (>= 0.1.4)
14
16
  rake (0.9.2)
15
17
  rcov (0.9.9)
18
+ rcov (0.9.9-java)
16
19
  rspec (2.3.0)
17
20
  rspec-core (~> 2.3.0)
18
21
  rspec-expectations (~> 2.3.0)
@@ -33,11 +36,14 @@ GEM
33
36
  archive-tar-minitar (>= 0.5.2)
34
37
 
35
38
  PLATFORMS
39
+ java
36
40
  ruby
37
41
 
38
42
  DEPENDENCIES
39
43
  bundler (~> 1.0.0)
40
44
  jeweler (~> 1.6.2)
45
+ json
46
+ json_pure
41
47
  rcov
42
48
  rspec (~> 2.3.0)
43
49
  ruby-debug19
data/README.md CHANGED
@@ -24,19 +24,29 @@ config.server.host #=> "localhost"
24
24
  config.admins.include? User.find_by_name("leon") #=> true
25
25
  ```
26
26
 
27
- ## Known Issues
27
+ Thanks to tonywok for starting the inheritance work... this is now possible:
28
28
 
29
- * Right now data is first in- first out. If you have 2 config files with the same name
30
- the last one in, wins.
31
- * There is no inheritence. You can't set global options and then over-ride them with
32
- another file.
29
+ ###structure:
30
+ ```
31
+ config/
32
+ --application.yml #=> (host: 'production.local')
33
+ --application/
34
+ -----development.yml #=> (host: 'development.local')
35
+ -----test.yml #=> (host: 'test.local')
36
+ ```
33
37
 
34
- You can however, augment the settings anytime you like.
38
+ if each has a host... then you can call it like so...
35
39
 
36
40
  ```ruby
37
- config.admins.pop #=> gives one of our admins.
41
+ ENV["APP_ENV"] ||= "test" #=> current support vars are "RACK_ENV", "RAILS_ENV", "APP_ENV"
42
+ MyConfig.application.host.should == "test.local"
38
43
  ```
39
44
 
45
+ ## Known Issues
46
+
47
+ * Right now data is first in- first out. If you have 2 config files with the same name
48
+ the last one in, wins.
49
+
40
50
  ## Future
41
51
 
42
52
  This is all I needed for now but I'd love to work out those issues mentioned above
@@ -55,6 +65,14 @@ configuration be a bit more flexible than a yml, json file would allow.
55
65
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
56
66
  * This list is from Jeweler. Which is awesome...
57
67
 
68
+ ## Contributors
69
+
70
+ Many thanks to anyone who sends patches, emails, love my way to keep this
71
+ software alive and a joy to maintain.
72
+
73
+ * github.com/tonywok
74
+ * github.com/al2o3cr (during pairing day at EdgeCase!)
75
+
58
76
  ## Copyright
59
77
 
60
78
  Copyright (c) 2011 Leon Gersing. See LICENSE.txt for
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{configulations}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Leon Gersing"]
12
- s.date = %q{2011-07-12}
11
+ s.authors = [%q{Leon Gersing}]
12
+ s.date = %q{2011-08-04}
13
13
  s.description = %q{Auto-create configuration objects for your applications from yml and json files.}
14
14
  s.email = %q{leongersing@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -50,21 +50,25 @@ Gem::Specification.new do |s|
50
50
  "spec/spec_helper.rb"
51
51
  ]
52
52
  s.homepage = %q{http://github.com/leongersing/configulations}
53
- s.licenses = ["MIT"]
54
- s.require_paths = ["lib"]
55
- s.rubygems_version = %q{1.6.2}
53
+ s.licenses = [%q{MIT}]
54
+ s.require_paths = [%q{lib}]
55
+ s.rubygems_version = %q{1.8.6}
56
56
  s.summary = %q{Simple Config class for Ruby apps.}
57
57
 
58
58
  if s.respond_to? :specification_version then
59
59
  s.specification_version = 3
60
60
 
61
61
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
+ s.add_runtime_dependency(%q<json_pure>, [">= 0"])
63
+ s.add_runtime_dependency(%q<json>, [">= 0"])
62
64
  s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
63
65
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
64
66
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
65
67
  s.add_development_dependency(%q<rcov>, [">= 0"])
66
68
  s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
67
69
  else
70
+ s.add_dependency(%q<json_pure>, [">= 0"])
71
+ s.add_dependency(%q<json>, [">= 0"])
68
72
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
69
73
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
70
74
  s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
@@ -72,6 +76,8 @@ Gem::Specification.new do |s|
72
76
  s.add_dependency(%q<ruby-debug19>, [">= 0"])
73
77
  end
74
78
  else
79
+ s.add_dependency(%q<json_pure>, [">= 0"])
80
+ s.add_dependency(%q<json>, [">= 0"])
75
81
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
76
82
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
77
83
  s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
@@ -36,7 +36,8 @@ class Configulations
36
36
 
37
37
  props[base] = config_data
38
38
 
39
- if Dir.exists?(dir = "#{File.dirname(file)}/#{base}")
39
+ dir = "#{File.dirname(file)}/#{base}"
40
+ if File.exists?(dir) and File.directory?(dir)
40
41
  child_configs = glob_directory_against_supported_extensions(dir)
41
42
  find_properties(child_configs, props[base], base)
42
43
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configulations
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 21
4
5
  prerelease:
5
- version: 0.2.0
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 1
10
+ version: 0.2.1
6
11
  platform: ruby
7
12
  authors:
8
13
  - Leon Gersing
@@ -10,64 +15,112 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-07-12 00:00:00 -04:00
14
- default_executable:
18
+ date: 2011-08-04 00:00:00 Z
15
19
  dependencies:
16
20
  - !ruby/object:Gem::Dependency
17
- name: rspec
18
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ type: :runtime
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ hash: 3
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ requirement: *id001
32
+ prerelease: false
33
+ name: json_pure
34
+ - !ruby/object:Gem::Dependency
35
+ type: :runtime
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ hash: 3
42
+ segments:
43
+ - 0
44
+ version: "0"
45
+ requirement: *id002
46
+ prerelease: false
47
+ name: json
48
+ - !ruby/object:Gem::Dependency
49
+ type: :development
50
+ version_requirements: &id003 !ruby/object:Gem::Requirement
19
51
  none: false
20
52
  requirements:
21
53
  - - ~>
22
54
  - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 2
58
+ - 3
59
+ - 0
23
60
  version: 2.3.0
24
- type: :development
61
+ requirement: *id003
25
62
  prerelease: false
26
- version_requirements: *id001
63
+ name: rspec
27
64
  - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: &id002 !ruby/object:Gem::Requirement
65
+ type: :development
66
+ version_requirements: &id004 !ruby/object:Gem::Requirement
30
67
  none: false
31
68
  requirements:
32
69
  - - ~>
33
70
  - !ruby/object:Gem::Version
71
+ hash: 23
72
+ segments:
73
+ - 1
74
+ - 0
75
+ - 0
34
76
  version: 1.0.0
35
- type: :development
77
+ requirement: *id004
36
78
  prerelease: false
37
- version_requirements: *id002
79
+ name: bundler
38
80
  - !ruby/object:Gem::Dependency
39
- name: jeweler
40
- requirement: &id003 !ruby/object:Gem::Requirement
81
+ type: :development
82
+ version_requirements: &id005 !ruby/object:Gem::Requirement
41
83
  none: false
42
84
  requirements:
43
85
  - - ~>
44
86
  - !ruby/object:Gem::Version
87
+ hash: 11
88
+ segments:
89
+ - 1
90
+ - 6
91
+ - 2
45
92
  version: 1.6.2
46
- type: :development
93
+ requirement: *id005
47
94
  prerelease: false
48
- version_requirements: *id003
95
+ name: jeweler
49
96
  - !ruby/object:Gem::Dependency
50
- name: rcov
51
- requirement: &id004 !ruby/object:Gem::Requirement
97
+ type: :development
98
+ version_requirements: &id006 !ruby/object:Gem::Requirement
52
99
  none: false
53
100
  requirements:
54
101
  - - ">="
55
102
  - !ruby/object:Gem::Version
103
+ hash: 3
104
+ segments:
105
+ - 0
56
106
  version: "0"
57
- type: :development
107
+ requirement: *id006
58
108
  prerelease: false
59
- version_requirements: *id004
109
+ name: rcov
60
110
  - !ruby/object:Gem::Dependency
61
- name: ruby-debug19
62
- requirement: &id005 !ruby/object:Gem::Requirement
111
+ type: :development
112
+ version_requirements: &id007 !ruby/object:Gem::Requirement
63
113
  none: false
64
114
  requirements:
65
115
  - - ">="
66
116
  - !ruby/object:Gem::Version
117
+ hash: 3
118
+ segments:
119
+ - 0
67
120
  version: "0"
68
- type: :development
121
+ requirement: *id007
69
122
  prerelease: false
70
- version_requirements: *id005
123
+ name: ruby-debug19
71
124
  description: Auto-create configuration objects for your applications from yml and json files.
72
125
  email: leongersing@gmail.com
73
126
  executables: []
@@ -109,7 +162,6 @@ files:
109
162
  - spec/configurator_spec.rb
110
163
  - spec/magic_hash_spec.rb
111
164
  - spec/spec_helper.rb
112
- has_rdoc: true
113
165
  homepage: http://github.com/leongersing/configulations
114
166
  licenses:
115
167
  - MIT
@@ -123,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
175
  requirements:
124
176
  - - ">="
125
177
  - !ruby/object:Gem::Version
126
- hash: 2454716717098569719
178
+ hash: 3
127
179
  segments:
128
180
  - 0
129
181
  version: "0"
@@ -132,11 +184,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
184
  requirements:
133
185
  - - ">="
134
186
  - !ruby/object:Gem::Version
187
+ hash: 3
188
+ segments:
189
+ - 0
135
190
  version: "0"
136
191
  requirements: []
137
192
 
138
193
  rubyforge_project:
139
- rubygems_version: 1.6.2
194
+ rubygems_version: 1.8.6
140
195
  signing_key:
141
196
  specification_version: 3
142
197
  summary: Simple Config class for Ruby apps.