configreader 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemspec +24 -0
- data/.gitignore +2 -0
- data/.rspec +3 -0
- data/.rvmrc +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +102 -0
- data/README.md +86 -0
- data/Rakefile +3 -0
- data/lib/configreader/config.rb +16 -0
- data/lib/configreader/engine.rb +11 -0
- data/lib/configreader/env_configreader.rb +17 -0
- data/lib/configreader/flat_configreader.rb +38 -0
- data/lib/configreader/version.rb +3 -0
- data/lib/configreader.rb +45 -0
- data/spec/config/auto_create/env/fake_env.yml +10 -0
- data/spec/config/auto_create/fake_simple.yml +8 -0
- data/spec/config/fake_env.yml +10 -0
- data/spec/config/fake_invalid.yml +5 -0
- data/spec/config/fake_simple.yml +8 -0
- data/spec/config/fake_site.yml +15 -0
- data/spec/lib/config_spec.rb +60 -0
- data/spec/lib/env_configreader_spec.rb +36 -0
- data/spec/lib/flat_configreader_spec.rb +34 -0
- data/spec/spec_helper.rb +12 -0
- metadata +124 -0
data/.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/configreader/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "configreader"
|
6
|
+
s.version = ConfigReader::VERSION
|
7
|
+
s.authors = ["Itay Adler"]
|
8
|
+
s.email = ["itayadler@gmail.com"]
|
9
|
+
s.homepage = "https://github.com/TheGiftsProject/configreader"
|
10
|
+
s.summary = %q{ConfigReader - An easy way to manage your configuration files}
|
11
|
+
s.description = %q{ConfigReader provides an easy way to load up your configuration YAML files into Ruby objects,
|
12
|
+
providing a more concise API to access your configuration data, by accessing methods instead of Hash keys. It also
|
13
|
+
allows you to configure environment aware configuration objects, and by so inverting the logic of
|
14
|
+
environment specific configuration into the ConfigReader.}
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.require_path = "lib"
|
18
|
+
s.test_files = Dir.glob('spec/lib/*_spec.rb')
|
19
|
+
|
20
|
+
|
21
|
+
s.add_dependency 'rails'
|
22
|
+
s.add_development_dependency 'rake'
|
23
|
+
s.add_development_dependency 'rspec'
|
24
|
+
end
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm --create use 1.9.2@config_reader
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
configreader (0.0.1)
|
5
|
+
rails
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (3.2.8)
|
11
|
+
actionpack (= 3.2.8)
|
12
|
+
mail (~> 2.4.4)
|
13
|
+
actionpack (3.2.8)
|
14
|
+
activemodel (= 3.2.8)
|
15
|
+
activesupport (= 3.2.8)
|
16
|
+
builder (~> 3.0.0)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
journey (~> 1.0.4)
|
19
|
+
rack (~> 1.4.0)
|
20
|
+
rack-cache (~> 1.2)
|
21
|
+
rack-test (~> 0.6.1)
|
22
|
+
sprockets (~> 2.1.3)
|
23
|
+
activemodel (3.2.8)
|
24
|
+
activesupport (= 3.2.8)
|
25
|
+
builder (~> 3.0.0)
|
26
|
+
activerecord (3.2.8)
|
27
|
+
activemodel (= 3.2.8)
|
28
|
+
activesupport (= 3.2.8)
|
29
|
+
arel (~> 3.0.2)
|
30
|
+
tzinfo (~> 0.3.29)
|
31
|
+
activeresource (3.2.8)
|
32
|
+
activemodel (= 3.2.8)
|
33
|
+
activesupport (= 3.2.8)
|
34
|
+
activesupport (3.2.8)
|
35
|
+
i18n (~> 0.6)
|
36
|
+
multi_json (~> 1.0)
|
37
|
+
arel (3.0.2)
|
38
|
+
builder (3.0.4)
|
39
|
+
diff-lcs (1.1.3)
|
40
|
+
erubis (2.7.0)
|
41
|
+
hike (1.2.1)
|
42
|
+
i18n (0.6.1)
|
43
|
+
journey (1.0.4)
|
44
|
+
json (1.7.5)
|
45
|
+
mail (2.4.4)
|
46
|
+
i18n (>= 0.4.0)
|
47
|
+
mime-types (~> 1.16)
|
48
|
+
treetop (~> 1.4.8)
|
49
|
+
mime-types (1.19)
|
50
|
+
multi_json (1.3.7)
|
51
|
+
polyglot (0.3.3)
|
52
|
+
rack (1.4.1)
|
53
|
+
rack-cache (1.2)
|
54
|
+
rack (>= 0.4)
|
55
|
+
rack-ssl (1.3.2)
|
56
|
+
rack
|
57
|
+
rack-test (0.6.2)
|
58
|
+
rack (>= 1.0)
|
59
|
+
rails (3.2.8)
|
60
|
+
actionmailer (= 3.2.8)
|
61
|
+
actionpack (= 3.2.8)
|
62
|
+
activerecord (= 3.2.8)
|
63
|
+
activeresource (= 3.2.8)
|
64
|
+
activesupport (= 3.2.8)
|
65
|
+
bundler (~> 1.0)
|
66
|
+
railties (= 3.2.8)
|
67
|
+
railties (3.2.8)
|
68
|
+
actionpack (= 3.2.8)
|
69
|
+
activesupport (= 3.2.8)
|
70
|
+
rack-ssl (~> 1.3.2)
|
71
|
+
rake (>= 0.8.7)
|
72
|
+
rdoc (~> 3.4)
|
73
|
+
thor (>= 0.14.6, < 2.0)
|
74
|
+
rake (0.9.2.2)
|
75
|
+
rdoc (3.12)
|
76
|
+
json (~> 1.4)
|
77
|
+
rspec (2.11.0)
|
78
|
+
rspec-core (~> 2.11.0)
|
79
|
+
rspec-expectations (~> 2.11.0)
|
80
|
+
rspec-mocks (~> 2.11.0)
|
81
|
+
rspec-core (2.11.1)
|
82
|
+
rspec-expectations (2.11.3)
|
83
|
+
diff-lcs (~> 1.1.3)
|
84
|
+
rspec-mocks (2.11.3)
|
85
|
+
sprockets (2.1.3)
|
86
|
+
hike (~> 1.2)
|
87
|
+
rack (~> 1.0)
|
88
|
+
tilt (~> 1.1, != 1.3.0)
|
89
|
+
thor (0.16.0)
|
90
|
+
tilt (1.3.3)
|
91
|
+
treetop (1.4.12)
|
92
|
+
polyglot
|
93
|
+
polyglot (>= 0.3.1)
|
94
|
+
tzinfo (0.3.35)
|
95
|
+
|
96
|
+
PLATFORMS
|
97
|
+
ruby
|
98
|
+
|
99
|
+
DEPENDENCIES
|
100
|
+
configreader!
|
101
|
+
rake
|
102
|
+
rspec
|
data/README.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
# ConfigReader 0.0.1 [![Build Status](https://secure.travis-ci.org/TheGiftsProject/configreader.png)](http://travis-ci.org/TheGiftsProject/configreader)
|
2
|
+
|
3
|
+
ConfigReader provides an easy way to load up your configuration YAML files into Ruby objects,
|
4
|
+
providing a more concise API to access your configuration data, by accessing methods instead of Hash keys. It also
|
5
|
+
allows you to configure environment aware configuration objects, keeping your code DRY.
|
6
|
+
|
7
|
+
Note: Only the first level YAML keys can be accessed as methods.
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Note: The examples are for a Rails 3 app.
|
12
|
+
|
13
|
+
* Add our gem to your Gemfile:
|
14
|
+
|
15
|
+
`gem 'configreader'`
|
16
|
+
|
17
|
+
* The most simple way to use ConfigReader is to change your existing config initializer files to use it
|
18
|
+
like so:
|
19
|
+
|
20
|
+
Let's say you have a YAML config like `config/initializers/example.rb`
|
21
|
+
```yaml
|
22
|
+
development:
|
23
|
+
some_config: 123
|
24
|
+
production:
|
25
|
+
some_config: 456
|
26
|
+
test:
|
27
|
+
some_config: 678
|
28
|
+
staging:
|
29
|
+
some_config: 154
|
30
|
+
```
|
31
|
+
|
32
|
+
In your config initializer, initialize an EnvConfigReader like so:
|
33
|
+
```ruby
|
34
|
+
EXAMPLE = ConfigReader::EnvConfigReader.new("example.yml")
|
35
|
+
```
|
36
|
+
|
37
|
+
Then you could access EXAMPLE config from anywhere in your Rails app:
|
38
|
+
```ruby
|
39
|
+
EXAMPLE.some_config
|
40
|
+
```
|
41
|
+
|
42
|
+
Since we are using an EnvConfigReader object, the some_config we asked for is loaded up from the current RAILS_ENVIRONMENT.
|
43
|
+
By default, ConfigReader will assume your config folder is your Rails.root/config, and will build the full path using it.
|
44
|
+
|
45
|
+
There's also a FlatConfigReader, which is the more basic version. it's useful for flat config files like so:
|
46
|
+
```yaml
|
47
|
+
key1: 1
|
48
|
+
key2: 2
|
49
|
+
```
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
FLAT = ConfigReader::FlatConfigReader.new("flat.yml")
|
53
|
+
FLAT.key1
|
54
|
+
```
|
55
|
+
|
56
|
+
## Automatically creating configuration objects
|
57
|
+
|
58
|
+
A more advanced feature ConfigReader offers, is automatically loading all your configuration files during the initialization
|
59
|
+
of your Rails app.
|
60
|
+
|
61
|
+
It's turned off by default, so to turn it on, we'll need to create an initializer for ConfigReader:
|
62
|
+
|
63
|
+
`config/initializers/configreader.rb`
|
64
|
+
```ruby
|
65
|
+
ConfigReader.initialize do
|
66
|
+
config.auto_create_config_objects = true
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
You're almost done, you'll need to move your YAML configuration files to the default configreader directory:
|
71
|
+
`#{Rails.root}/config/configreader`
|
72
|
+
|
73
|
+
The YAML files in the root configreader folder will be created with a FlatConfigReader, and the ones in the
|
74
|
+
`#{Rails.root}/config/configreader/env` will be created with an EnvConfigReader.
|
75
|
+
The configuration objects will be set as consts on Object, so you'll be able to access them from anywhere
|
76
|
+
in your Rails app, just like we already did in the initializers.
|
77
|
+
|
78
|
+
`auto_create_class` - You can also override the default auto_create behavior to set the consts instead on Object, to something else
|
79
|
+
like ConfigReader, so then you'll be able to access them using that object: `ConfigReader::EXAMPLE`
|
80
|
+
|
81
|
+
`auto_create_config_folder` - The default value to the config_folder is `#{Rails.root}/config/configreader`. Use this config
|
82
|
+
item to override it another path.
|
83
|
+
|
84
|
+
## Requirements
|
85
|
+
|
86
|
+
Ruby 1.8.7+, Rails 3.0+.
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
module ConfigReader
|
2
|
+
class Config
|
3
|
+
|
4
|
+
attr_accessor :auto_create_config_folder, :auto_create_config_objects, :auto_create_class
|
5
|
+
|
6
|
+
def self.default
|
7
|
+
new.instance_eval {
|
8
|
+
@auto_create_config_folder = "#{ConfigReader.app_root}/config/configreader"
|
9
|
+
@auto_create_config_objects = false
|
10
|
+
@auto_create_class = Object
|
11
|
+
|
12
|
+
self
|
13
|
+
}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative './flat_configreader'
|
2
|
+
|
3
|
+
module ConfigReader
|
4
|
+
|
5
|
+
class EnvConfigReader < FlatConfigReader
|
6
|
+
|
7
|
+
class EnvironmentNotFoundInYaml < StandardError ; end
|
8
|
+
|
9
|
+
def initialize(file_name)
|
10
|
+
super(file_name)
|
11
|
+
@data = @data[Rails.env]
|
12
|
+
raise EnvironmentNotFoundInYaml.new if @data.nil?
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module ConfigReader
|
2
|
+
|
3
|
+
class FlatConfigReader
|
4
|
+
|
5
|
+
def initialize(config)
|
6
|
+
@data = config.is_a?(String) ? read_file(config) : config
|
7
|
+
|
8
|
+
remove_id_method
|
9
|
+
end
|
10
|
+
|
11
|
+
def method_missing(name)
|
12
|
+
@data[name.to_s]
|
13
|
+
end
|
14
|
+
|
15
|
+
#def local_constant_names
|
16
|
+
# nil
|
17
|
+
#end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def relative_path
|
22
|
+
"#{Rails.root}/config"
|
23
|
+
end
|
24
|
+
|
25
|
+
def full_path(file_name)
|
26
|
+
File.join(relative_path, file_name)
|
27
|
+
end
|
28
|
+
|
29
|
+
def read_file(file_name)
|
30
|
+
YAML.load_file(full_path(file_name))
|
31
|
+
end
|
32
|
+
|
33
|
+
def remove_id_method
|
34
|
+
instance_eval "undef id" if methods.any? { |method| method == "id" }
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
data/lib/configreader.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'active_support/dependencies'
|
2
|
+
require 'configreader/config'
|
3
|
+
require 'yaml'
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
module ConfigReader
|
7
|
+
|
8
|
+
mattr_accessor :app_root
|
9
|
+
mattr_accessor :initialized
|
10
|
+
|
11
|
+
def self.initialize(&block)
|
12
|
+
return if ConfigReader.initialized
|
13
|
+
ConfigReader.module_eval &block
|
14
|
+
build_config_files
|
15
|
+
ConfigReader.initialized = true
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.config
|
19
|
+
@config ||= ConfigReader::Config.default
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.build_config_files
|
23
|
+
return unless config.auto_create_config_objects
|
24
|
+
|
25
|
+
build_files(config.auto_create_config_folder, FlatConfigReader)
|
26
|
+
build_files("#{config.auto_create_config_folder}/env", EnvConfigReader)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.build_files(folder, klass)
|
30
|
+
Dir["#{folder}/*.yml"].each do |file|
|
31
|
+
path = Pathname.new(file)
|
32
|
+
next if path.directory? or !path.exist?
|
33
|
+
|
34
|
+
config.auto_create_class.class_eval do
|
35
|
+
const_set(path.basename('.*').to_s.upcase, klass.new(YAML.load_file(file)))
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
require 'configreader/engine'
|
44
|
+
require 'configreader/flat_configreader'
|
45
|
+
require 'configreader/env_configreader'
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ConfigReader::Config do
|
4
|
+
|
5
|
+
after :each do
|
6
|
+
Object.send(:remove_const, :FAKE_SIMPLE) if Object.const_defined? :FAKE_SIMPLE
|
7
|
+
Object.send(:remove_const, :FAKE_ENV) if Object.const_defined? :FAKE_ENV
|
8
|
+
ConfigReader.initialized = false
|
9
|
+
end
|
10
|
+
|
11
|
+
describe :initialize do
|
12
|
+
it "should update config attributes" do
|
13
|
+
ConfigReader.initialize do
|
14
|
+
config.auto_create_config_objects = true
|
15
|
+
config.auto_create_class = ConfigReader
|
16
|
+
config.auto_create_config_folder = "moshe"
|
17
|
+
end
|
18
|
+
ConfigReader.config.auto_create_config_objects.should == true
|
19
|
+
ConfigReader.config.auto_create_class.should == ConfigReader
|
20
|
+
ConfigReader.config.auto_create_config_folder.should == "moshe"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should not be able to run initialize more than once" do
|
24
|
+
ConfigReader.initialize do
|
25
|
+
config.auto_create_config_objects = true
|
26
|
+
end
|
27
|
+
ConfigReader.config.auto_create_config_objects.should == true
|
28
|
+
ConfigReader.initialize do
|
29
|
+
config.auto_create_config_objects = false
|
30
|
+
end
|
31
|
+
ConfigReader.config.auto_create_config_objects.should == true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe :build_config_files do
|
36
|
+
before :all do
|
37
|
+
ConfigReader.config.auto_create_config_folder = "#{ConfigReader::Engine.root}/spec/config/auto_create"
|
38
|
+
ConfigReader.config.auto_create_class = Object
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should auto-build flat config file" do
|
42
|
+
ConfigReader.config.auto_create_config_objects = true
|
43
|
+
ConfigReader.build_config_files
|
44
|
+
FAKE_SIMPLE.class.should == ConfigReader::FlatConfigReader
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should auto-build env config file" do
|
48
|
+
ConfigReader.config.auto_create_config_objects = true
|
49
|
+
ConfigReader.build_config_files
|
50
|
+
FAKE_ENV.class.should == ConfigReader::EnvConfigReader
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should not auto-build when auto_create_config_objects is false" do
|
54
|
+
ConfigReader.config.auto_create_config_objects = false
|
55
|
+
ConfigReader.build_config_files
|
56
|
+
expect { FAKE_SIMPLE }.to raise_error(NameError)
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require_relative '../../lib/configreader/env_configreader'
|
3
|
+
|
4
|
+
describe ConfigReader::EnvConfigReader do
|
5
|
+
|
6
|
+
before do
|
7
|
+
ConfigReader::EnvConfigReader.any_instance.stub(:relative_path => "#{ConfigReader::Engine.root}/spec/config")
|
8
|
+
end
|
9
|
+
|
10
|
+
subject { ConfigReader::EnvConfigReader.new("fake_env.yml") }
|
11
|
+
|
12
|
+
it "should let you access data under the right env" do
|
13
|
+
subject.devid.should == "devid"
|
14
|
+
subject.appid.should == "appid"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should not let you access data under other enviroments" do
|
18
|
+
subject.only_production.should be_nil
|
19
|
+
subject.devid.should_not == "wrong"
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should enable you to read the id attribute" do
|
23
|
+
subject.id.should == "testID"
|
24
|
+
end
|
25
|
+
|
26
|
+
context "configuration file with out test env" do
|
27
|
+
it "should raise an EnvironmentNotFoundInYaml when loading" do
|
28
|
+
expect {
|
29
|
+
ConfigReader::EnvConfigReader.new("fake_invalid.yml")
|
30
|
+
}.to raise_error(ConfigReader::EnvConfigReader::EnvironmentNotFoundInYaml)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ConfigReader::FlatConfigReader do
|
4
|
+
|
5
|
+
before do
|
6
|
+
ConfigReader::FlatConfigReader.any_instance.stub(:relative_path => "#{ConfigReader::Engine.root}/spec/config")
|
7
|
+
end
|
8
|
+
|
9
|
+
subject { ConfigReader::FlatConfigReader.new("fake_simple.yml") }
|
10
|
+
|
11
|
+
it "should enable you to read attributes from the yml" do
|
12
|
+
subject.boolean_value.should be_true
|
13
|
+
subject.integer_value.should == 3
|
14
|
+
subject.string_value.should == "my name"
|
15
|
+
subject.quoted_string_value.should == "qtd my name"
|
16
|
+
subject.complex_value.should == {'a' => 1, 'b' => 2}
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should enable you to read the id attribute" do
|
20
|
+
subject.id.should == "file"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should return nil for attributes that don't exist" do
|
24
|
+
subject.blah_attribute.should be_nil
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should raise File not found for wrong name of yml" do
|
28
|
+
expect {
|
29
|
+
ConfigReader::FlatConfigReader.new("non_existing.yml")
|
30
|
+
}.to raise_error(Errno::ENOENT)
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'configreader'
|
4
|
+
|
5
|
+
#Monkey patching rails env to be test
|
6
|
+
Rails.env = "test"
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
10
|
+
config.run_all_when_everything_filtered = true
|
11
|
+
config.filter_run :focus
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: configreader
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Itay Adler
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: ! "ConfigReader provides an easy way to load up your configuration YAML
|
63
|
+
files into Ruby objects,\n providing a more concise API to access
|
64
|
+
your configuration data, by accessing methods instead of Hash keys. It also\n allows
|
65
|
+
you to configure environment aware configuration objects, and by so inverting the
|
66
|
+
logic of\n environment specific configuration into the ConfigReader."
|
67
|
+
email:
|
68
|
+
- itayadler@gmail.com
|
69
|
+
executables: []
|
70
|
+
extensions: []
|
71
|
+
extra_rdoc_files: []
|
72
|
+
files:
|
73
|
+
- .gemspec
|
74
|
+
- .gitignore
|
75
|
+
- .rspec
|
76
|
+
- .rvmrc
|
77
|
+
- Gemfile
|
78
|
+
- Gemfile.lock
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- lib/configreader.rb
|
82
|
+
- lib/configreader/config.rb
|
83
|
+
- lib/configreader/engine.rb
|
84
|
+
- lib/configreader/env_configreader.rb
|
85
|
+
- lib/configreader/flat_configreader.rb
|
86
|
+
- lib/configreader/version.rb
|
87
|
+
- spec/config/auto_create/env/fake_env.yml
|
88
|
+
- spec/config/auto_create/fake_simple.yml
|
89
|
+
- spec/config/fake_env.yml
|
90
|
+
- spec/config/fake_invalid.yml
|
91
|
+
- spec/config/fake_simple.yml
|
92
|
+
- spec/config/fake_site.yml
|
93
|
+
- spec/lib/config_spec.rb
|
94
|
+
- spec/lib/env_configreader_spec.rb
|
95
|
+
- spec/lib/flat_configreader_spec.rb
|
96
|
+
- spec/spec_helper.rb
|
97
|
+
homepage: https://github.com/TheGiftsProject/configreader
|
98
|
+
licenses: []
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ! '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ! '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
requirements: []
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 1.8.24
|
118
|
+
signing_key:
|
119
|
+
specification_version: 3
|
120
|
+
summary: ConfigReader - An easy way to manage your configuration files
|
121
|
+
test_files:
|
122
|
+
- spec/lib/config_spec.rb
|
123
|
+
- spec/lib/env_configreader_spec.rb
|
124
|
+
- spec/lib/flat_configreader_spec.rb
|