app_conf 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +0 -1
- data/README.markdown +6 -1
- data/app_conf.gemspec +1 -3
- data/lib/app_conf.rb +3 -0
- data/spec/app_conf_spec.rb +15 -7
- metadata +6 -27
- data/Guardfile +0 -5
- data/spec/minitest_fakefs_patch.rb +0 -11
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MGJjZTMxODA4OGI2MjYwYTM5NmU1MDVhMmE3ZDMzOTQ5ODMyODRiZg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MjE4ZTljZDNkYmE2MzYwNzQ0ZmJmZDJhYmM5NWU3NjZlZGM4ZjAyYw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
Y2JmMzI1YTBjY2U5OGU3NDZiMmNmNDU3ZTY2OTUxNjUwOGIxY2YwMzQ4NzEx
|
10
|
+
Nzg2YjNkZWM5NTBhNDEyZmE2MGI2NWY3YjI0MDRjZTU2ZjJhNDFhMDc5N2Ix
|
11
|
+
ZTJmYzBlZDBlMzdmMTcyYmRjMDg1MTM4ZmJiYmFjY2JmZDY5ZTU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MDhkYTNkNTYxOTFhZTUxMWU4MDYyNTc5Y2JlYmQ4MjUwYTkzOTZiMTY4ZjU5
|
14
|
+
ZGQ5NTZjMDI1OGEyZWU4ZjIzMGE0NzUzOTFhZTk2YTk5N2NiNjhkMzNhYTk2
|
15
|
+
N2I5MTAyNDE5MDM5Yzc5MDViMmQ3MDY2YWJhYjY3ZWVhN2Y0NjQ=
|
data/.gitignore
CHANGED
data/README.markdown
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
AppConf
|
2
2
|
----------------------------------
|
3
|
-
|
3
|
+
|
4
|
+
YAML Backed Application Wide Configuration with a few extras
|
5
|
+
|
6
|
+
(AppConfig like)
|
4
7
|
|
5
8
|
* Supports nested key/values
|
6
9
|
* Loading and Saving of YAML files
|
@@ -11,6 +14,7 @@ YAML Backed Application Wide Configuration with a few extras (AppConfig)
|
|
11
14
|
|
12
15
|
Installation
|
13
16
|
----------------------------------
|
17
|
+
|
14
18
|
gem install app_conf
|
15
19
|
|
16
20
|
Example
|
@@ -93,6 +97,7 @@ Other stuff
|
|
93
97
|
* No gem dependencies
|
94
98
|
* Fully tested with MiniTest::Spec
|
95
99
|
* Packaged as a Gem on RubyGems.org
|
100
|
+
* Less than 80 lines of code (not including tests)
|
96
101
|
|
97
102
|
Why
|
98
103
|
----------------------------------
|
data/app_conf.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'base64'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'app_conf'
|
5
|
-
s.version = '0.4.
|
5
|
+
s.version = '0.4.2'
|
6
6
|
s.authors = 'Phil Thompson'
|
7
7
|
s.email = Base64.decode64("cGhpbEBlbGVjdHJpY3Zpc2lvbnMuY29t\n")
|
8
8
|
s.summary = 'Simplest YAML Backed Application Wide Configuration (AppConfig)'
|
@@ -13,7 +13,5 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
14
14
|
|
15
15
|
s.require_path = 'lib'
|
16
|
-
|
17
|
-
s.add_development_dependency 'fakefs'
|
18
16
|
end
|
19
17
|
|
data/lib/app_conf.rb
CHANGED
data/spec/app_conf_spec.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
|
-
gem 'minitest'
|
1
|
+
gem 'minitest', require: 'minitest/autorun'
|
2
|
+
gem 'fakefs', require: 'fakefs/safe'
|
2
3
|
|
3
4
|
require 'fakefs/safe'
|
4
5
|
require 'minitest/autorun'
|
5
|
-
require_relative 'minitest_fakefs_patch'
|
6
6
|
require_relative '../lib/app_conf'
|
7
7
|
|
8
|
+
module MiniTest
|
9
|
+
module Assertions
|
10
|
+
alias :actual_diff :diff
|
11
|
+
|
12
|
+
# Stop FakeFS interfering with saving multiline diffs
|
13
|
+
def diff exp, act
|
14
|
+
FakeFS.without do
|
15
|
+
actual_diff exp, act
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
8
21
|
describe AppConf do
|
9
22
|
before do
|
10
23
|
FakeFS.activate!
|
@@ -151,11 +164,6 @@ user:
|
|
151
164
|
$conf.user.name.first.must_equal 'Joe'
|
152
165
|
end
|
153
166
|
|
154
|
-
it 'handles empty files' do
|
155
|
-
File.open('empty.yml', 'w') {}
|
156
|
-
$conf.load('empty.yml')
|
157
|
-
end
|
158
|
-
|
159
167
|
it 'allows additional keys to be set' do
|
160
168
|
$conf.user.name.last = 'Bloggs'
|
161
169
|
$conf.user.name.last.must_equal 'Bloggs'
|
metadata
CHANGED
@@ -1,32 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_conf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Phil Thompson
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: fakefs
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
11
|
+
date: 2013-10-30 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
30
13
|
description:
|
31
14
|
email: !binary |-
|
32
15
|
cGhpbEBlbGVjdHJpY3Zpc2lvbnMuY29t
|
@@ -35,39 +18,35 @@ extensions: []
|
|
35
18
|
extra_rdoc_files: []
|
36
19
|
files:
|
37
20
|
- .gitignore
|
38
|
-
- Guardfile
|
39
21
|
- LICENSE
|
40
22
|
- README.markdown
|
41
23
|
- Rakefile
|
42
24
|
- app_conf.gemspec
|
43
25
|
- lib/app_conf.rb
|
44
26
|
- spec/app_conf_spec.rb
|
45
|
-
- spec/minitest_fakefs_patch.rb
|
46
27
|
homepage: https://github.com/PhilT/app_conf
|
47
28
|
licenses: []
|
29
|
+
metadata: {}
|
48
30
|
post_install_message:
|
49
31
|
rdoc_options: []
|
50
32
|
require_paths:
|
51
33
|
- lib
|
52
34
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
35
|
requirements:
|
55
36
|
- - ! '>='
|
56
37
|
- !ruby/object:Gem::Version
|
57
38
|
version: '0'
|
58
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
40
|
requirements:
|
61
41
|
- - ! '>='
|
62
42
|
- !ruby/object:Gem::Version
|
63
43
|
version: 1.3.6
|
64
44
|
requirements: []
|
65
45
|
rubyforge_project:
|
66
|
-
rubygems_version:
|
46
|
+
rubygems_version: 2.0.7
|
67
47
|
signing_key:
|
68
|
-
specification_version:
|
48
|
+
specification_version: 4
|
69
49
|
summary: Simplest YAML Backed Application Wide Configuration (AppConfig)
|
70
50
|
test_files:
|
71
51
|
- spec/app_conf_spec.rb
|
72
|
-
- spec/minitest_fakefs_patch.rb
|
73
52
|
has_rdoc:
|
data/Guardfile
DELETED