yappconfig 0.3.0 → 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.
Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +52 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Gemfile +4 -14
  5. data/Gemfile.lock +231 -131
  6. data/LICENSE.txt +1 -1
  7. data/README.md +21 -1
  8. data/Rakefile +10 -38
  9. data/lib/app-config/railtie.rb +7 -0
  10. data/lib/app-config/version.rb +3 -0
  11. data/lib/app-config.rb +3 -3
  12. data/yappconfig.gemspec +18 -108
  13. metadata +17 -87
  14. data/VERSION +0 -1
  15. data/spec/app-config/rails_spec.rb +0 -37
  16. data/spec/app-config_spec.rb +0 -87
  17. data/spec/config/config.yml +0 -0
  18. data/spec/config/reloader.yml +0 -1
  19. data/spec/config/single_stage.yml +0 -1
  20. data/spec/config/test.yml +0 -6
  21. data/spec/dummy/.gitignore +0 -15
  22. data/spec/dummy/Gemfile +0 -38
  23. data/spec/dummy/Gemfile.lock +0 -111
  24. data/spec/dummy/README.rdoc +0 -261
  25. data/spec/dummy/Rakefile +0 -7
  26. data/spec/dummy/app/assets/images/rails.png +0 -0
  27. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  28. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  29. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  30. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  31. data/spec/dummy/app/mailers/.gitkeep +0 -0
  32. data/spec/dummy/app/models/.gitkeep +0 -0
  33. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  34. data/spec/dummy/config/application.rb +0 -59
  35. data/spec/dummy/config/boot.rb +0 -6
  36. data/spec/dummy/config/config.yml +0 -0
  37. data/spec/dummy/config/database.yml +0 -25
  38. data/spec/dummy/config/environment.rb +0 -5
  39. data/spec/dummy/config/environments/development.rb +0 -37
  40. data/spec/dummy/config/environments/production.rb +0 -67
  41. data/spec/dummy/config/environments/test.rb +0 -37
  42. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  43. data/spec/dummy/config/initializers/inflections.rb +0 -15
  44. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  45. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  46. data/spec/dummy/config/initializers/session_store.rb +0 -8
  47. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  48. data/spec/dummy/config/locales/en.yml +0 -5
  49. data/spec/dummy/config/routes.rb +0 -58
  50. data/spec/dummy/config.ru +0 -4
  51. data/spec/dummy/db/seeds.rb +0 -7
  52. data/spec/dummy/lib/assets/.gitkeep +0 -0
  53. data/spec/dummy/lib/tasks/.gitkeep +0 -0
  54. data/spec/dummy/log/.gitkeep +0 -0
  55. data/spec/dummy/public/404.html +0 -26
  56. data/spec/dummy/public/422.html +0 -26
  57. data/spec/dummy/public/500.html +0 -25
  58. data/spec/dummy/public/favicon.ico +0 -0
  59. data/spec/dummy/public/index.html +0 -241
  60. data/spec/dummy/public/robots.txt +0 -5
  61. data/spec/dummy/script/rails +0 -6
  62. data/spec/dummy/test/fixtures/.gitkeep +0 -0
  63. data/spec/dummy/test/functional/.gitkeep +0 -0
  64. data/spec/dummy/test/integration/.gitkeep +0 -0
  65. data/spec/dummy/test/performance/browsing_test.rb +0 -12
  66. data/spec/dummy/test/test_helper.rb +0 -13
  67. data/spec/dummy/test/unit/.gitkeep +0 -0
  68. data/spec/dummy/vendor/assets/javascripts/.gitkeep +0 -0
  69. data/spec/dummy/vendor/assets/stylesheets/.gitkeep +0 -0
  70. data/spec/dummy/vendor/plugins/.gitkeep +0 -0
  71. data/spec/spec_helper.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 86fa071d295ce243988b61331112c2dddf65b94d
4
- data.tar.gz: 1019201f688b45269d105374848abb18c7e6f87e
2
+ SHA256:
3
+ metadata.gz: 89dcdb970a8486133e8671e45da691f96b1bc83b6d5861140004df588da16b50
4
+ data.tar.gz: 8d136fef17deb32ba184cfc338e2affcb0781c9882179b1da25406c9eaf2d72e
5
5
  SHA512:
6
- metadata.gz: 0f3f8bafd5eb07fa07a7aeba04eb06ce8390768b1981e4b36057f06952d6ad7d3e7398d98481c8fbf19c0bbd9e66b49dbedae57d561aa42b15ba22f60d8c677c
7
- data.tar.gz: 5b48be30acc6dc5a7305578900689094f0d4b3513cde4f6562b44adabf6dedff43381f4ddd864bc924d9afb68ccf2bcc8bea0571e5bbe9a67fff4e48919fdda0
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 "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
- # Gems required for this gem
4
- gem "hashie"
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
4
 
6
- # Add dependencies to develop your gem here.
7
- # Include everything needed to run rake, tests, features, etc.
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: http://rubygems.org/
8
+ remote: https://rubygems.org/
3
9
  specs:
4
- actionmailer (3.2.22)
5
- actionpack (= 3.2.22)
6
- mail (~> 2.5.4)
7
- actionpack (3.2.22)
8
- activemodel (= 3.2.22)
9
- activesupport (= 3.2.22)
10
- builder (~> 3.0.0)
11
- erubis (~> 2.7.0)
12
- journey (~> 1.0.4)
13
- rack (~> 1.4.5)
14
- rack-cache (~> 1.2)
15
- rack-test (~> 0.6.1)
16
- sprockets (~> 2.2.1)
17
- activemodel (3.2.22)
18
- activesupport (= 3.2.22)
19
- builder (~> 3.0.0)
20
- activerecord (3.2.22)
21
- activemodel (= 3.2.22)
22
- activesupport (= 3.2.22)
23
- arel (~> 3.0.2)
24
- tzinfo (~> 0.3.29)
25
- activeresource (3.2.22)
26
- activemodel (= 3.2.22)
27
- activesupport (= 3.2.22)
28
- activesupport (3.2.22)
29
- i18n (~> 0.6, >= 0.6.4)
30
- multi_json (~> 1.0)
31
- addressable (2.3.8)
32
- arel (3.0.3)
33
- builder (3.0.4)
34
- diff-lcs (1.1.3)
35
- docile (1.1.5)
36
- erubis (2.7.0)
37
- faraday (0.8.9)
38
- multipart-post (~> 1.2.0)
39
- git (1.2.9.1)
40
- github_api (0.10.1)
41
- addressable
42
- faraday (~> 0.8.1)
43
- hashie (>= 1.2)
44
- multi_json (~> 1.4)
45
- nokogiri (~> 1.5.2)
46
- oauth2
47
- hashie (3.4.2)
48
- highline (1.7.3)
49
- hike (1.2.3)
50
- i18n (0.7.0)
51
- jeweler (1.8.8)
52
- builder
53
- bundler (~> 1.0)
54
- git (>= 1.2.5)
55
- github_api (= 0.10.1)
56
- highline (>= 1.6.15)
57
- nokogiri (= 1.5.10)
58
- rake
59
- rdoc
60
- journey (1.0.4)
61
- json (1.8.3)
62
- jwt (1.5.1)
63
- mail (2.5.4)
64
- mime-types (~> 1.16)
65
- treetop (~> 1.4.8)
66
- mime-types (1.25.1)
67
- multi_json (1.11.2)
68
- multi_xml (0.5.5)
69
- multipart-post (1.2.0)
70
- nokogiri (1.5.10)
71
- oauth2 (1.0.0)
72
- faraday (>= 0.8, < 0.10)
73
- jwt (~> 1.0)
74
- multi_json (~> 1.3)
75
- multi_xml (~> 0.5)
76
- rack (~> 1.2)
77
- polyglot (0.3.5)
78
- rack (1.4.7)
79
- rack-cache (1.2)
80
- rack (>= 0.4)
81
- rack-ssl (1.3.4)
82
- rack
83
- rack-test (0.6.3)
84
- rack (>= 1.0)
85
- rails (3.2.22)
86
- actionmailer (= 3.2.22)
87
- actionpack (= 3.2.22)
88
- activerecord (= 3.2.22)
89
- activeresource (= 3.2.22)
90
- activesupport (= 3.2.22)
91
- bundler (~> 1.0)
92
- railties (= 3.2.22)
93
- railties (3.2.22)
94
- actionpack (= 3.2.22)
95
- activesupport (= 3.2.22)
96
- rack-ssl (~> 1.3.2)
97
- rake (>= 0.8.7)
98
- rdoc (~> 3.4)
99
- thor (>= 0.14.6, < 2.0)
100
- rake (10.4.2)
101
- rdoc (3.12.2)
102
- json (~> 1.4)
103
- rspec (2.8.0)
104
- rspec-core (~> 2.8.0)
105
- rspec-expectations (~> 2.8.0)
106
- rspec-mocks (~> 2.8.0)
107
- rspec-core (2.8.0)
108
- rspec-expectations (2.8.0)
109
- diff-lcs (~> 1.1.2)
110
- rspec-mocks (2.8.0)
111
- simplecov (0.10.0)
112
- docile (~> 1.1.0)
113
- json (~> 1.8)
114
- simplecov-html (~> 0.10.0)
115
- simplecov-html (0.10.0)
116
- sprockets (2.2.3)
117
- hike (~> 1.2)
118
- multi_json (~> 1.0)
119
- rack (~> 1.0)
120
- tilt (~> 1.1, != 1.3.0)
121
- thor (0.19.1)
122
- tilt (1.4.1)
123
- treetop (1.4.15)
124
- polyglot
125
- polyglot (>= 0.3.1)
126
- tzinfo (0.3.44)
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
- ruby
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
- hashie
134
- jeweler (~> 1.8.3)
135
- rails (~> 3.2.3)
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
- 1.10.5
241
+ 2.6.3
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 David Somers <jalada@gmail.com>
1
+ Copyright (c) David Somers <david@jalada.co.uk>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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
+ [![Gem Version](https://badge.fury.io/rb/yappconfig.svg)](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) 2012 David Somers <jalada@gmail.com>. See LICENSE.txt for further
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
- # encoding: utf-8
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['spec/**/*_spec.rb']
5
+ spec.pattern = FileList["spec/**/*_spec.rb"]
33
6
  end
34
7
 
35
8
  RSpec::Core::RakeTask.new(:rcov) do |spec|
36
- spec.pattern = 'spec/**/*_spec.rb'
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 'rdoc/task'
15
+ require "rdoc/task"
16
+ require "app-config/version"
43
17
  Rake::RDocTask.new do |rdoc|
44
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
45
-
46
- rdoc.rdoc_dir = 'rdoc'
47
- rdoc.title = "yappconfig #{version}"
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
@@ -3,6 +3,13 @@ require 'rails'
3
3
  module AppConfig
4
4
  class Railtie < Rails::Railtie
5
5
  config.before_configuration do
6
+
7
+ # AppConfig can be used in conjunction with dotenv, and as per their
8
+ # code, we are running `.load` ahead of them.
9
+ if defined?(Dotenv::Railtie) && Dotenv::Railtie.respond_to?(:load)
10
+ Dotenv::Railtie.load
11
+ end
12
+
6
13
  AppConfig.configure do |config|
7
14
  config.config_file = Rails.root.join("config", "config.yml")
8
15
  config.environment = Rails.env
@@ -0,0 +1,3 @@
1
+ module AppConfig
2
+ VERSION = "1.0.0"
3
+ 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.load(ERB.new(IO.read @options.config_file).result)
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
  #