rails_config_loader 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -14,6 +14,10 @@ module ConfigLoader
14
14
  loader.new file_path, options = {}
15
15
  end
16
16
 
17
+ def load_hash file_path, options = {}
18
+ load(file_path, options).as_hash
19
+ end
20
+
17
21
  def load_yaml file_path, options = {}
18
22
  ConfigLoader::Yaml.new file_path, options = {}
19
23
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rails_config_loader"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = "2012-05-07"
12
+ s.date = "2012-05-09"
13
13
  s.description = "Load yaml and json config files and \n make the structures easily available for use in the app."
14
14
  s.email = "kmandrup@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -6,6 +6,10 @@ module Rails
6
6
  end
7
7
  end
8
8
 
9
+ class LoadMe
10
+ include ConfigLoader
11
+ end
12
+
9
13
  describe ConfigLoader::Yaml do
10
14
  subject { config }
11
15
  let(:config) { ConfigLoader::Yaml.new('facebook.yml') }
@@ -36,6 +40,20 @@ describe ConfigLoader::Yaml do
36
40
  end
37
41
  end
38
42
 
43
+ describe ConfigLoader do
44
+ subject { loadme }
45
+
46
+ let(:loadme) { LoadMe.new }
47
+
48
+ describe '.load' do
49
+ specify { subject.load('htc.yml').as_hash.domain.should == 'www.htc.com' }
50
+ end
51
+
52
+ describe '.load_hash' do
53
+ specify { subject.load_hash('htc.yml').domain.should == 'www.htc.com' }
54
+ end
55
+ end
56
+
39
57
  describe 'Delegator' do
40
58
  subject { config }
41
59
  let(:config) { MainApp.config }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_config_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-07 00:00:00.000000000 Z
12
+ date: 2012-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  segments:
171
171
  - 0
172
- hash: 1179121962009242759
172
+ hash: -2060976259246285744
173
173
  required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements: