yappconfig 0.3.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +52 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +4 -14
- data/Gemfile.lock +231 -131
- data/LICENSE.txt +1 -1
- data/README.md +21 -1
- data/Rakefile +10 -38
- data/lib/app-config/version.rb +3 -0
- data/lib/app-config.rb +3 -3
- data/yappconfig.gemspec +18 -108
- metadata +17 -87
- data/VERSION +0 -1
- data/spec/app-config/rails_spec.rb +0 -37
- data/spec/app-config_spec.rb +0 -87
- data/spec/config/config.yml +0 -0
- data/spec/config/reloader.yml +0 -1
- data/spec/config/single_stage.yml +0 -1
- data/spec/config/test.yml +0 -6
- data/spec/dummy/.gitignore +0 -15
- data/spec/dummy/Gemfile +0 -38
- data/spec/dummy/Gemfile.lock +0 -111
- data/spec/dummy/README.rdoc +0 -261
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/images/rails.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config/application.rb +0 -59
- data/spec/dummy/config/boot.rb +0 -6
- data/spec/dummy/config/config.yml +0 -0
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -37
- data/spec/dummy/config/environments/production.rb +0 -67
- data/spec/dummy/config/environments/test.rb +0 -37
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -58
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/db/seeds.rb +0 -7
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/lib/tasks/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/index.html +0 -241
- data/spec/dummy/public/robots.txt +0 -5
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy/test/fixtures/.gitkeep +0 -0
- data/spec/dummy/test/functional/.gitkeep +0 -0
- data/spec/dummy/test/integration/.gitkeep +0 -0
- data/spec/dummy/test/performance/browsing_test.rb +0 -12
- data/spec/dummy/test/test_helper.rb +0 -13
- data/spec/dummy/test/unit/.gitkeep +0 -0
- data/spec/dummy/vendor/assets/javascripts/.gitkeep +0 -0
- data/spec/dummy/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/dummy/vendor/plugins/.gitkeep +0 -0
- data/spec/spec_helper.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 89dcdb970a8486133e8671e45da691f96b1bc83b6d5861140004df588da16b50
|
4
|
+
data.tar.gz: 8d136fef17deb32ba184cfc338e2affcb0781c9882179b1da25406c9eaf2d72e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab66d64bd2a66d173cf7e8267fcbc9c2b8c99bc95e0145a41d47cb4902d40c646598bf8c5a1eca0b65eceef7f3f31efb781a82633e2e00cd8dd4e4f4b6de959b
|
7
|
+
data.tar.gz: 9e226314466bdd94bbaad467458bf140f8322e11e87dfdeae2e354311c89f3c9eb5c92def500ad4a7e9bc782cad7aeb8dd18535b639870c960db324ec5cc63ca
|
data/.gitignore
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
coverage.data
|
4
|
+
|
5
|
+
# rdoc generated
|
6
|
+
rdoc
|
7
|
+
|
8
|
+
# yard generated
|
9
|
+
doc
|
10
|
+
.yardoc
|
11
|
+
|
12
|
+
# bundler
|
13
|
+
.bundle
|
14
|
+
|
15
|
+
# jeweler generated
|
16
|
+
pkg
|
17
|
+
|
18
|
+
# Dev only
|
19
|
+
.rvmrc
|
20
|
+
|
21
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
22
|
+
#
|
23
|
+
# * Create a file at ~/.gitignore
|
24
|
+
# * Include files you want ignored
|
25
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
26
|
+
#
|
27
|
+
# After doing this, these files will be ignored in all your git projects,
|
28
|
+
# saving you from having to 'pollute' every project you touch with them
|
29
|
+
#
|
30
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
31
|
+
#
|
32
|
+
# For MacOS:
|
33
|
+
#
|
34
|
+
#.DS_Store
|
35
|
+
|
36
|
+
# For TextMate
|
37
|
+
#*.tmproj
|
38
|
+
#tmtags
|
39
|
+
|
40
|
+
# For emacs:
|
41
|
+
#*~
|
42
|
+
#\#*
|
43
|
+
#.\#*
|
44
|
+
|
45
|
+
# For vim:
|
46
|
+
#*.swp
|
47
|
+
|
48
|
+
# For redcar:
|
49
|
+
#.redcar
|
50
|
+
|
51
|
+
# For rubinius:
|
52
|
+
#*.rbc
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
# 1.0.0
|
2
|
+
|
3
|
+
v1 drops support for older Ruby and Rails. You should be running at least
|
4
|
+
Ruby 3.1 and Rails 7. Lock yappconfig to `< 1` in your Gemfile if you need to
|
5
|
+
use it with older versions. Thanks [JonathanAndrews](https://github.com/jonathanandrews)
|
6
|
+
for your help!
|
data/Gemfile
CHANGED
@@ -1,16 +1,6 @@
|
|
1
|
-
source "
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
gem "hashie"
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
5
4
|
|
6
|
-
#
|
7
|
-
|
8
|
-
group :development do
|
9
|
-
gem "rspec", "~> 2.8.0"
|
10
|
-
gem "rdoc", "~> 3.12"
|
11
|
-
gem "bundler"
|
12
|
-
gem "jeweler", "~> 1.8.3"
|
13
|
-
gem "simplecov"
|
14
|
-
|
15
|
-
gem "rails", "~> 3.2.3"
|
16
|
-
end
|
5
|
+
# Specify your gem's dependencies in yappconfig.gemspec
|
6
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,141 +1,241 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
yappconfig (1.0.0)
|
5
|
+
hashie
|
6
|
+
|
1
7
|
GEM
|
2
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
3
9
|
specs:
|
4
|
-
|
5
|
-
actionpack (=
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
10
|
+
actioncable (7.2.2.1)
|
11
|
+
actionpack (= 7.2.2.1)
|
12
|
+
activesupport (= 7.2.2.1)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (>= 0.6.1)
|
15
|
+
zeitwerk (~> 2.6)
|
16
|
+
actionmailbox (7.2.2.1)
|
17
|
+
actionpack (= 7.2.2.1)
|
18
|
+
activejob (= 7.2.2.1)
|
19
|
+
activerecord (= 7.2.2.1)
|
20
|
+
activestorage (= 7.2.2.1)
|
21
|
+
activesupport (= 7.2.2.1)
|
22
|
+
mail (>= 2.8.0)
|
23
|
+
actionmailer (7.2.2.1)
|
24
|
+
actionpack (= 7.2.2.1)
|
25
|
+
actionview (= 7.2.2.1)
|
26
|
+
activejob (= 7.2.2.1)
|
27
|
+
activesupport (= 7.2.2.1)
|
28
|
+
mail (>= 2.8.0)
|
29
|
+
rails-dom-testing (~> 2.2)
|
30
|
+
actionpack (7.2.2.1)
|
31
|
+
actionview (= 7.2.2.1)
|
32
|
+
activesupport (= 7.2.2.1)
|
33
|
+
nokogiri (>= 1.8.5)
|
34
|
+
racc
|
35
|
+
rack (>= 2.2.4, < 3.2)
|
36
|
+
rack-session (>= 1.0.1)
|
37
|
+
rack-test (>= 0.6.3)
|
38
|
+
rails-dom-testing (~> 2.2)
|
39
|
+
rails-html-sanitizer (~> 1.6)
|
40
|
+
useragent (~> 0.16)
|
41
|
+
actiontext (7.2.2.1)
|
42
|
+
actionpack (= 7.2.2.1)
|
43
|
+
activerecord (= 7.2.2.1)
|
44
|
+
activestorage (= 7.2.2.1)
|
45
|
+
activesupport (= 7.2.2.1)
|
46
|
+
globalid (>= 0.6.0)
|
47
|
+
nokogiri (>= 1.8.5)
|
48
|
+
actionview (7.2.2.1)
|
49
|
+
activesupport (= 7.2.2.1)
|
50
|
+
builder (~> 3.1)
|
51
|
+
erubi (~> 1.11)
|
52
|
+
rails-dom-testing (~> 2.2)
|
53
|
+
rails-html-sanitizer (~> 1.6)
|
54
|
+
activejob (7.2.2.1)
|
55
|
+
activesupport (= 7.2.2.1)
|
56
|
+
globalid (>= 0.3.6)
|
57
|
+
activemodel (7.2.2.1)
|
58
|
+
activesupport (= 7.2.2.1)
|
59
|
+
activerecord (7.2.2.1)
|
60
|
+
activemodel (= 7.2.2.1)
|
61
|
+
activesupport (= 7.2.2.1)
|
62
|
+
timeout (>= 0.4.0)
|
63
|
+
activestorage (7.2.2.1)
|
64
|
+
actionpack (= 7.2.2.1)
|
65
|
+
activejob (= 7.2.2.1)
|
66
|
+
activerecord (= 7.2.2.1)
|
67
|
+
activesupport (= 7.2.2.1)
|
68
|
+
marcel (~> 1.0)
|
69
|
+
activesupport (7.2.2.1)
|
70
|
+
base64
|
71
|
+
benchmark (>= 0.3)
|
72
|
+
bigdecimal
|
73
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
74
|
+
connection_pool (>= 2.2.5)
|
75
|
+
drb
|
76
|
+
i18n (>= 1.6, < 2)
|
77
|
+
logger (>= 1.4.2)
|
78
|
+
minitest (>= 5.1)
|
79
|
+
securerandom (>= 0.3)
|
80
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
81
|
+
base64 (0.2.0)
|
82
|
+
benchmark (0.4.0)
|
83
|
+
bigdecimal (3.1.9)
|
84
|
+
builder (3.3.0)
|
85
|
+
concurrent-ruby (1.3.5)
|
86
|
+
connection_pool (2.5.0)
|
87
|
+
crass (1.0.6)
|
88
|
+
date (3.4.1)
|
89
|
+
diff-lcs (1.5.1)
|
90
|
+
docile (1.4.1)
|
91
|
+
drb (2.2.1)
|
92
|
+
erubi (1.13.1)
|
93
|
+
globalid (1.2.1)
|
94
|
+
activesupport (>= 6.1)
|
95
|
+
hashie (5.0.0)
|
96
|
+
i18n (1.14.7)
|
97
|
+
concurrent-ruby (~> 1.0)
|
98
|
+
io-console (0.8.0)
|
99
|
+
irb (1.15.1)
|
100
|
+
pp (>= 0.6.0)
|
101
|
+
rdoc (>= 4.0.0)
|
102
|
+
reline (>= 0.4.2)
|
103
|
+
logger (1.6.5)
|
104
|
+
loofah (2.24.0)
|
105
|
+
crass (~> 1.0.2)
|
106
|
+
nokogiri (>= 1.12.0)
|
107
|
+
mail (2.8.1)
|
108
|
+
mini_mime (>= 0.1.1)
|
109
|
+
net-imap
|
110
|
+
net-pop
|
111
|
+
net-smtp
|
112
|
+
marcel (1.0.4)
|
113
|
+
mini_mime (1.1.5)
|
114
|
+
minitest (5.25.4)
|
115
|
+
net-imap (0.5.5)
|
116
|
+
date
|
117
|
+
net-protocol
|
118
|
+
net-pop (0.1.2)
|
119
|
+
net-protocol
|
120
|
+
net-protocol (0.2.2)
|
121
|
+
timeout
|
122
|
+
net-smtp (0.5.1)
|
123
|
+
net-protocol
|
124
|
+
nio4r (2.7.4)
|
125
|
+
nokogiri (1.18.2-aarch64-linux-gnu)
|
126
|
+
racc (~> 1.4)
|
127
|
+
nokogiri (1.18.2-aarch64-linux-musl)
|
128
|
+
racc (~> 1.4)
|
129
|
+
nokogiri (1.18.2-arm-linux-gnu)
|
130
|
+
racc (~> 1.4)
|
131
|
+
nokogiri (1.18.2-arm-linux-musl)
|
132
|
+
racc (~> 1.4)
|
133
|
+
nokogiri (1.18.2-arm64-darwin)
|
134
|
+
racc (~> 1.4)
|
135
|
+
nokogiri (1.18.2-x86_64-darwin)
|
136
|
+
racc (~> 1.4)
|
137
|
+
nokogiri (1.18.2-x86_64-linux-gnu)
|
138
|
+
racc (~> 1.4)
|
139
|
+
nokogiri (1.18.2-x86_64-linux-musl)
|
140
|
+
racc (~> 1.4)
|
141
|
+
pp (0.6.2)
|
142
|
+
prettyprint
|
143
|
+
prettyprint (0.2.0)
|
144
|
+
psych (5.2.3)
|
145
|
+
date
|
146
|
+
stringio
|
147
|
+
racc (1.8.1)
|
148
|
+
rack (3.1.9)
|
149
|
+
rack-session (2.1.0)
|
150
|
+
base64 (>= 0.1.0)
|
151
|
+
rack (>= 3.0.0)
|
152
|
+
rack-test (2.2.0)
|
153
|
+
rack (>= 1.3)
|
154
|
+
rackup (2.2.1)
|
155
|
+
rack (>= 3)
|
156
|
+
rails (7.2.2.1)
|
157
|
+
actioncable (= 7.2.2.1)
|
158
|
+
actionmailbox (= 7.2.2.1)
|
159
|
+
actionmailer (= 7.2.2.1)
|
160
|
+
actionpack (= 7.2.2.1)
|
161
|
+
actiontext (= 7.2.2.1)
|
162
|
+
actionview (= 7.2.2.1)
|
163
|
+
activejob (= 7.2.2.1)
|
164
|
+
activemodel (= 7.2.2.1)
|
165
|
+
activerecord (= 7.2.2.1)
|
166
|
+
activestorage (= 7.2.2.1)
|
167
|
+
activesupport (= 7.2.2.1)
|
168
|
+
bundler (>= 1.15.0)
|
169
|
+
railties (= 7.2.2.1)
|
170
|
+
rails-dom-testing (2.2.0)
|
171
|
+
activesupport (>= 5.0.0)
|
172
|
+
minitest
|
173
|
+
nokogiri (>= 1.6)
|
174
|
+
rails-html-sanitizer (1.6.2)
|
175
|
+
loofah (~> 2.21)
|
176
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
177
|
+
railties (7.2.2.1)
|
178
|
+
actionpack (= 7.2.2.1)
|
179
|
+
activesupport (= 7.2.2.1)
|
180
|
+
irb (~> 1.13)
|
181
|
+
rackup (>= 1.0.0)
|
182
|
+
rake (>= 12.2)
|
183
|
+
thor (~> 1.0, >= 1.2.2)
|
184
|
+
zeitwerk (~> 2.6)
|
185
|
+
rake (13.2.1)
|
186
|
+
rdoc (6.11.0)
|
187
|
+
psych (>= 4.0.0)
|
188
|
+
reline (0.6.0)
|
189
|
+
io-console (~> 0.5)
|
190
|
+
rspec (3.13.0)
|
191
|
+
rspec-core (~> 3.13.0)
|
192
|
+
rspec-expectations (~> 3.13.0)
|
193
|
+
rspec-mocks (~> 3.13.0)
|
194
|
+
rspec-core (3.13.2)
|
195
|
+
rspec-support (~> 3.13.0)
|
196
|
+
rspec-expectations (3.13.3)
|
197
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
198
|
+
rspec-support (~> 3.13.0)
|
199
|
+
rspec-mocks (3.13.2)
|
200
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
201
|
+
rspec-support (~> 3.13.0)
|
202
|
+
rspec-support (3.13.2)
|
203
|
+
securerandom (0.4.1)
|
204
|
+
simplecov (0.22.0)
|
205
|
+
docile (~> 1.1)
|
206
|
+
simplecov-html (~> 0.11)
|
207
|
+
simplecov_json_formatter (~> 0.1)
|
208
|
+
simplecov-html (0.13.1)
|
209
|
+
simplecov_json_formatter (0.1.4)
|
210
|
+
stringio (3.1.2)
|
211
|
+
thor (1.3.2)
|
212
|
+
timeout (0.4.3)
|
213
|
+
tzinfo (2.0.6)
|
214
|
+
concurrent-ruby (~> 1.0)
|
215
|
+
useragent (0.16.11)
|
216
|
+
websocket-driver (0.7.7)
|
217
|
+
base64
|
218
|
+
websocket-extensions (>= 0.1.0)
|
219
|
+
websocket-extensions (0.1.5)
|
220
|
+
zeitwerk (2.6.18)
|
127
221
|
|
128
222
|
PLATFORMS
|
129
|
-
|
223
|
+
aarch64-linux-gnu
|
224
|
+
aarch64-linux-musl
|
225
|
+
arm-linux-gnu
|
226
|
+
arm-linux-musl
|
227
|
+
arm64-darwin
|
228
|
+
x86_64-darwin
|
229
|
+
x86_64-linux-gnu
|
230
|
+
x86_64-linux-musl
|
130
231
|
|
131
232
|
DEPENDENCIES
|
132
233
|
bundler
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
rdoc (~> 3.12)
|
137
|
-
rspec (~> 2.8.0)
|
234
|
+
rails (~> 7.0)
|
235
|
+
rdoc (~> 6.11)
|
236
|
+
rspec (~> 3.0)
|
138
237
|
simplecov
|
238
|
+
yappconfig!
|
139
239
|
|
140
240
|
BUNDLED WITH
|
141
|
-
|
241
|
+
2.6.3
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
A clean way to use a YAML file for configuration.
|
4
4
|
|
5
|
+
[](https://badge.fury.io/rb/yappconfig)
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
Your app must be using Psych 4 or newer. This means you probably need to be
|
10
|
+
using Ruby 3.1 or newer, and Rails 7 or newer.
|
11
|
+
|
12
|
+
If you want to use yappconfig with an older version of Ruby or Rails, lock
|
13
|
+
yappconfig to `< 1` in your Gemfile.
|
14
|
+
|
5
15
|
## Configuring
|
6
16
|
|
7
17
|
In Rails, yappconfig should Just Work™. For everything else you can configure it
|
@@ -79,6 +89,16 @@ it has been overridden with a new hash. In this example, you would have to
|
|
79
89
|
explicitly set `port` again in production. For this reason, it's probably best
|
80
90
|
to avoid too much nesting...
|
81
91
|
|
92
|
+
## Running the tests
|
93
|
+
|
94
|
+
```
|
95
|
+
bundle install
|
96
|
+
cd spec/dummy
|
97
|
+
bundle install
|
98
|
+
cd ../..
|
99
|
+
rspec
|
100
|
+
````
|
101
|
+
|
82
102
|
|
83
103
|
## Contributing to yappconfig
|
84
104
|
|
@@ -97,6 +117,6 @@ to avoid too much nesting...
|
|
97
117
|
|
98
118
|
## Copyright
|
99
119
|
|
100
|
-
Copyright (c)
|
120
|
+
Copyright (c) David Somers <david@jalada.co.uk>. See LICENSE.txt for further
|
101
121
|
details.
|
102
122
|
|
data/Rakefile
CHANGED
@@ -1,50 +1,22 @@
|
|
1
|
-
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
2
3
|
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
begin
|
6
|
-
Bundler.setup(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
require 'rake'
|
13
|
-
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
-
gem.name = "yappconfig"
|
18
|
-
gem.homepage = "http://github.com/jalada/yappconfig"
|
19
|
-
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{An application config, best for Rails apps}
|
21
|
-
gem.description = %Q{yappconfig provides your application with a global configuration based on the environment. The configuration is loaded in from YAML. It has sensible defaults for Rails applications}
|
22
|
-
gem.email = "jalada@gmail.com"
|
23
|
-
gem.authors = ["David Somers"]
|
24
|
-
|
25
|
-
gem.files.exclude 'spec/dummy'
|
26
|
-
end
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
28
|
-
|
29
|
-
require 'rspec/core'
|
30
|
-
require 'rspec/core/rake_task'
|
31
4
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
-
spec.pattern = FileList[
|
5
|
+
spec.pattern = FileList["spec/**/*_spec.rb"]
|
33
6
|
end
|
34
7
|
|
35
8
|
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
36
|
-
spec.pattern =
|
9
|
+
spec.pattern = "spec/**/*_spec.rb"
|
37
10
|
spec.rcov = true
|
38
11
|
end
|
39
12
|
|
40
13
|
task :default => :spec
|
41
14
|
|
42
|
-
require
|
15
|
+
require "rdoc/task"
|
16
|
+
require "app-config/version"
|
43
17
|
Rake::RDocTask.new do |rdoc|
|
44
|
-
|
45
|
-
|
46
|
-
rdoc.
|
47
|
-
rdoc.
|
48
|
-
rdoc.rdoc_files.include('README*')
|
49
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
18
|
+
rdoc.rdoc_dir = "rdoc"
|
19
|
+
rdoc.title = "yappconfig #{AppConfig::VERSION}"
|
20
|
+
rdoc.rdoc_files.include("README*")
|
21
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
50
22
|
end
|
data/lib/app-config.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'app-config/railtie' if defined?(Rails)
|
2
2
|
require 'erb'
|
3
3
|
|
4
|
-
# Public: Application Configuration singleton. Config is stored within as
|
4
|
+
# Public: Application Configuration singleton. Config is stored within as
|
5
5
|
# a class
|
6
6
|
module AppConfig
|
7
7
|
|
@@ -22,7 +22,7 @@ module AppConfig
|
|
22
22
|
# Returns the new config.
|
23
23
|
def initialize(options)
|
24
24
|
@options = options
|
25
|
-
yaml = YAML.
|
25
|
+
yaml = YAML.safe_load(ERB.new(IO.read @options.config_file).result, aliases: true)
|
26
26
|
yaml = yaml[@options.environment] if @options.environment
|
27
27
|
@config = Hashie::Mash.new yaml
|
28
28
|
@last_mtime = File.mtime @options.config_file
|
@@ -48,7 +48,7 @@ module AppConfig
|
|
48
48
|
end
|
49
49
|
|
50
50
|
# Public: Configure AppConfig. Note that repeated calls to configure will
|
51
|
-
# reset all configuration and clear the existing config class. Therefore you
|
51
|
+
# reset all configuration and clear the existing config class. Therefore you
|
52
52
|
# need to configure AppConfig all in one go, or alternatively access
|
53
53
|
# configuration parameters directly e.g. AppConfig.configuration.config_file
|
54
54
|
#
|