figgy 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +4 -0
- data/README.md +2 -2
- data/figgy.gemspec +1 -1
- data/lib/figgy.rb +4 -0
- data/lib/figgy/hash.rb +4 -0
- data/lib/figgy/version.rb +1 -1
- data/spec/figgy_spec.rb +5 -0
- data/spec/spec_helper.rb +11 -3
- metadata +21 -57
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 499c24c1fd7a7e05cd66b372eca6346fb7da29c1
|
4
|
+
data.tar.gz: ac9627e72c4c9523e9edd4b02dea51a5547a3f3d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8756cc7930b50be03ed15cf75b2a296537e9bebeb02457fee2d8a4036289600efdb30527bd60f9a26acb03da2e23106c4d7c3bd9f1891b4c2fb143261a1087b0
|
7
|
+
data.tar.gz: 4eca2e791b7aae2f972d63826e4d57442cc277e553486411efb41387358def8825827619c9e2ec067bf17b31e782e1dd1a6ba921b8ad04e272eac0dad86fbbee
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# figgy
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/figgy.svg)](http://badge.fury.io/rb/figgy)
|
4
|
-
[![Build Status](https://secure.travis-ci.org/pd/figgy.
|
4
|
+
[![Build Status](https://secure.travis-ci.org/pd/figgy.svg)](http://travis-ci.org/pd/figgy)
|
5
5
|
[![Dependency Status](https://gemnasium.com/pd/figgy.svg)](https://gemnasium.com/pd/figgy)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/pd/figgy.png)](https://codeclimate.com/github/pd/figgy)
|
7
|
-
[![Coverage Status](https://
|
7
|
+
[![Coverage Status](https://img.shields.io/coveralls/pd/figgy.svg)](https://coveralls.io/r/pd/figgy?branch=master)
|
8
8
|
|
9
9
|
Provides convenient access to configuration files in various formats, with
|
10
10
|
support for overriding the values based on environment, hostname, locale, or
|
data/figgy.gemspec
CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency "rspec", '~> 3.0'
|
23
23
|
s.add_development_dependency "simplecov", '~> 0.9'
|
24
24
|
s.add_development_dependency "coveralls"
|
25
|
-
s.add_development_dependency "
|
25
|
+
s.add_development_dependency "rest-client", '1.6.8' if RUBY_VERSION == "1.8.7"
|
26
26
|
s.add_development_dependency "heredoc_unindent"
|
27
27
|
end
|
data/lib/figgy.rb
CHANGED
data/lib/figgy/hash.rb
CHANGED
data/lib/figgy/version.rb
CHANGED
data/spec/figgy_spec.rb
CHANGED
@@ -188,6 +188,11 @@ describe Figgy do
|
|
188
188
|
write_config 'reason_to_do_this', nil.to_yaml
|
189
189
|
expect(test_config.reason_to_do_this).to eq(nil)
|
190
190
|
end
|
191
|
+
|
192
|
+
it "prioritizes hash methods over keys in the YAML file" do
|
193
|
+
write_config 'bad', { 'default' => 'something'}.to_yaml
|
194
|
+
expect(test_config.bad.default).to eq(nil)
|
195
|
+
end
|
191
196
|
end
|
192
197
|
|
193
198
|
context "multiple roots" do
|
data/spec/spec_helper.rb
CHANGED
@@ -10,10 +10,13 @@ SimpleCov.start
|
|
10
10
|
|
11
11
|
require 'rspec'
|
12
12
|
require 'figgy'
|
13
|
-
require 'aruba/api'
|
14
13
|
require 'heredoc_unindent'
|
15
14
|
|
16
15
|
module Figgy::SpecHelpers
|
16
|
+
def current_dir
|
17
|
+
File.join(Dir.getwd, 'tmp')
|
18
|
+
end
|
19
|
+
|
17
20
|
def test_config
|
18
21
|
Figgy.build do |config|
|
19
22
|
config.root = current_dir
|
@@ -23,12 +26,17 @@ module Figgy::SpecHelpers
|
|
23
26
|
|
24
27
|
def write_config(filename, contents)
|
25
28
|
filename = "#{filename}.yml" unless filename =~ /\./
|
26
|
-
|
29
|
+
full_filename = File.join(current_dir, filename)
|
30
|
+
|
31
|
+
FileUtils.mkdir_p(File.dirname(full_filename))
|
32
|
+
|
33
|
+
file = File.new(full_filename, "w+")
|
34
|
+
file.write(contents)
|
35
|
+
file.close
|
27
36
|
end
|
28
37
|
end
|
29
38
|
|
30
39
|
RSpec.configure do |c|
|
31
|
-
c.include Aruba::Api
|
32
40
|
c.include Figgy::SpecHelpers
|
33
41
|
|
34
42
|
c.after { FileUtils.rm_rf(current_dir) }
|
metadata
CHANGED
@@ -1,126 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figgy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kyle Hargraves
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: json
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '3.0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '3.0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: simplecov
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0.9'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0.9'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: coveralls
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: aruba
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
|
-
type: :development
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
80
|
+
- - ">="
|
108
81
|
- !ruby/object:Gem::Version
|
109
82
|
version: '0'
|
110
83
|
- !ruby/object:Gem::Dependency
|
111
84
|
name: heredoc_unindent
|
112
85
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
86
|
requirements:
|
115
|
-
- -
|
87
|
+
- - ">="
|
116
88
|
- !ruby/object:Gem::Version
|
117
89
|
version: '0'
|
118
90
|
type: :development
|
119
91
|
prerelease: false
|
120
92
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
93
|
requirements:
|
123
|
-
- -
|
94
|
+
- - ">="
|
124
95
|
- !ruby/object:Gem::Version
|
125
96
|
version: '0'
|
126
97
|
description: Access YAML, JSON (and ...) configuration files with ease
|
@@ -130,8 +101,8 @@ executables: []
|
|
130
101
|
extensions: []
|
131
102
|
extra_rdoc_files: []
|
132
103
|
files:
|
133
|
-
- .gitignore
|
134
|
-
- .travis.yml
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
135
106
|
- Gemfile
|
136
107
|
- LICENSE.txt
|
137
108
|
- README.md
|
@@ -148,33 +119,26 @@ files:
|
|
148
119
|
homepage: http://github.com/pd/figgy
|
149
120
|
licenses:
|
150
121
|
- MIT
|
122
|
+
metadata: {}
|
151
123
|
post_install_message:
|
152
124
|
rdoc_options: []
|
153
125
|
require_paths:
|
154
126
|
- lib
|
155
127
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
-
none: false
|
157
128
|
requirements:
|
158
|
-
- -
|
129
|
+
- - ">="
|
159
130
|
- !ruby/object:Gem::Version
|
160
131
|
version: '0'
|
161
|
-
segments:
|
162
|
-
- 0
|
163
|
-
hash: 3860378607253701998
|
164
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
-
none: false
|
166
133
|
requirements:
|
167
|
-
- -
|
134
|
+
- - ">="
|
168
135
|
- !ruby/object:Gem::Version
|
169
136
|
version: '0'
|
170
|
-
segments:
|
171
|
-
- 0
|
172
|
-
hash: 3860378607253701998
|
173
137
|
requirements: []
|
174
138
|
rubyforge_project:
|
175
|
-
rubygems_version:
|
139
|
+
rubygems_version: 2.4.7
|
176
140
|
signing_key:
|
177
|
-
specification_version:
|
141
|
+
specification_version: 4
|
178
142
|
summary: Configuration file reading
|
179
143
|
test_files:
|
180
144
|
- spec/figgy_spec.rb
|