flame 5.0.0.rc4 → 5.0.0.rc7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +929 -0
- data/LICENSE.txt +19 -0
- data/README.md +135 -0
- data/lib/flame/application.rb +47 -46
- data/lib/flame/config.rb +73 -0
- data/lib/flame/controller/actions.rb +122 -0
- data/lib/flame/{dispatcher → controller}/cookies.rb +8 -3
- data/lib/flame/controller/path_to.rb +34 -10
- data/lib/flame/controller.rb +45 -78
- data/lib/flame/dispatcher/request.rb +22 -6
- data/lib/flame/dispatcher/routes.rb +22 -14
- data/lib/flame/dispatcher/static.rb +13 -9
- data/lib/flame/dispatcher.rb +15 -18
- data/lib/flame/errors/argument_not_assigned_error.rb +3 -8
- data/lib/flame/errors/config_file_not_found_error.rb +17 -0
- data/lib/flame/errors/controller_not_found_error.rb +19 -0
- data/lib/flame/errors/route_arguments_order_error.rb +3 -10
- data/lib/flame/errors/route_extra_arguments_error.rb +7 -20
- data/lib/flame/errors/route_not_found_error.rb +4 -9
- data/lib/flame/errors/template_not_found_error.rb +2 -8
- data/lib/flame/path.rb +36 -18
- data/lib/flame/render.rb +13 -5
- data/lib/flame/router/controller_finder.rb +56 -0
- data/lib/flame/router/route.rb +9 -0
- data/lib/flame/router/routes.rb +56 -9
- data/lib/flame/router/routes_refine/mounting.rb +57 -0
- data/lib/flame/router/routes_refine.rb +144 -0
- data/lib/flame/router.rb +7 -157
- data/lib/flame/validators.rb +14 -10
- data/lib/flame/version.rb +1 -1
- data/lib/flame.rb +12 -5
- metadata +107 -96
- data/bin/flame +0 -16
- data/lib/flame/application/config.rb +0 -49
- data/template/.editorconfig +0 -15
- data/template/.gitignore +0 -28
- data/template/.rubocop.yml +0 -14
- data/template/Gemfile +0 -55
- data/template/Rakefile +0 -824
- data/template/application.rb.erb +0 -10
- data/template/config/config.rb.erb +0 -56
- data/template/config/database.example.yml +0 -5
- data/template/config/deploy.example.yml +0 -2
- data/template/config/puma.rb +0 -56
- data/template/config/sequel.rb.erb +0 -22
- data/template/config/server.example.yml +0 -32
- data/template/config/session.example.yml +0 -7
- data/template/config.ru.erb +0 -72
- data/template/controllers/_controller.rb.erb +0 -14
- data/template/controllers/site/_controller.rb.erb +0 -18
- data/template/controllers/site/index_controller.rb.erb +0 -12
- data/template/db/.keep +0 -0
- data/template/filewatchers.yml +0 -12
- data/template/helpers/.keep +0 -0
- data/template/lib/.keep +0 -0
- data/template/locales/en.yml +0 -0
- data/template/models/.keep +0 -0
- data/template/public/.keep +0 -0
- data/template/server +0 -200
- data/template/services/.keep +0 -0
- data/template/views/.keep +0 -0
- data/template/views/site/index.html.erb.erb +0 -1
- data/template/views/site/layout.html.erb.erb +0 -10
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flame
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.
|
4
|
+
version: 5.0.0.rc7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Popov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -25,257 +25,290 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: alt_memery
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: gorilla_patch
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '5'
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '3.0'
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '5'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: psych
|
43
63
|
requirement: !ruby/object:Gem::Requirement
|
44
64
|
requirements:
|
45
65
|
- - "~>"
|
46
66
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
67
|
+
version: '4.0'
|
48
68
|
type: :runtime
|
49
69
|
prerelease: false
|
50
70
|
version_requirements: !ruby/object:Gem::Requirement
|
51
71
|
requirements:
|
52
72
|
- - "~>"
|
53
73
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
74
|
+
version: '4.0'
|
55
75
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
76
|
+
name: rack
|
57
77
|
requirement: !ruby/object:Gem::Requirement
|
58
78
|
requirements:
|
59
79
|
- - "~>"
|
60
80
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
81
|
+
version: '2.1'
|
62
82
|
type: :runtime
|
63
83
|
prerelease: false
|
64
84
|
version_requirements: !ruby/object:Gem::Requirement
|
65
85
|
requirements:
|
66
86
|
- - "~>"
|
67
87
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
88
|
+
version: '2.1'
|
69
89
|
- !ruby/object:Gem::Dependency
|
70
90
|
name: tilt
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
72
92
|
requirements:
|
73
|
-
- - "
|
93
|
+
- - "~>"
|
74
94
|
- !ruby/object:Gem::Version
|
75
95
|
version: '2.0'
|
76
|
-
- - "<"
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '3'
|
79
96
|
type: :runtime
|
80
97
|
prerelease: false
|
81
98
|
version_requirements: !ruby/object:Gem::Requirement
|
82
99
|
requirements:
|
83
|
-
- - "
|
100
|
+
- - "~>"
|
84
101
|
- !ruby/object:Gem::Version
|
85
102
|
version: '2.0'
|
86
|
-
- - "<"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '3'
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
104
|
+
name: pry-byebug
|
91
105
|
requirement: !ruby/object:Gem::Requirement
|
92
106
|
requirements:
|
93
107
|
- - "~>"
|
94
108
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
109
|
+
version: '3.9'
|
96
110
|
type: :development
|
97
111
|
prerelease: false
|
98
112
|
version_requirements: !ruby/object:Gem::Requirement
|
99
113
|
requirements:
|
100
114
|
- - "~>"
|
101
115
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
116
|
+
version: '3.9'
|
103
117
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
118
|
+
name: bundler
|
105
119
|
requirement: !ruby/object:Gem::Requirement
|
106
120
|
requirements:
|
107
121
|
- - "~>"
|
108
122
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
123
|
+
version: '2.0'
|
110
124
|
type: :development
|
111
125
|
prerelease: false
|
112
126
|
version_requirements: !ruby/object:Gem::Requirement
|
113
127
|
requirements:
|
114
128
|
- - "~>"
|
115
129
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
130
|
+
version: '2.0'
|
117
131
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
132
|
+
name: bundler-audit
|
119
133
|
requirement: !ruby/object:Gem::Requirement
|
120
134
|
requirements:
|
121
135
|
- - "~>"
|
122
136
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
137
|
+
version: 0.9.0
|
124
138
|
type: :development
|
125
139
|
prerelease: false
|
126
140
|
version_requirements: !ruby/object:Gem::Requirement
|
127
141
|
requirements:
|
128
142
|
- - "~>"
|
129
143
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
144
|
+
version: 0.9.0
|
131
145
|
- !ruby/object:Gem::Dependency
|
132
|
-
name:
|
146
|
+
name: gem_toys
|
133
147
|
requirement: !ruby/object:Gem::Requirement
|
134
148
|
requirements:
|
135
149
|
- - "~>"
|
136
150
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
151
|
+
version: 0.12.1
|
138
152
|
type: :development
|
139
153
|
prerelease: false
|
140
154
|
version_requirements: !ruby/object:Gem::Requirement
|
141
155
|
requirements:
|
142
156
|
- - "~>"
|
143
157
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
158
|
+
version: 0.12.1
|
145
159
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
160
|
+
name: toys
|
147
161
|
requirement: !ruby/object:Gem::Requirement
|
148
162
|
requirements:
|
149
163
|
- - "~>"
|
150
164
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
165
|
+
version: 0.13.1
|
152
166
|
type: :development
|
153
167
|
prerelease: false
|
154
168
|
version_requirements: !ruby/object:Gem::Requirement
|
155
169
|
requirements:
|
156
170
|
- - "~>"
|
157
171
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
172
|
+
version: 0.13.1
|
159
173
|
- !ruby/object:Gem::Dependency
|
160
|
-
name:
|
174
|
+
name: better_errors
|
161
175
|
requirement: !ruby/object:Gem::Requirement
|
162
176
|
requirements:
|
163
177
|
- - "~>"
|
164
178
|
- !ruby/object:Gem::Version
|
165
|
-
version: '
|
179
|
+
version: '2.0'
|
166
180
|
type: :development
|
167
181
|
prerelease: false
|
168
182
|
version_requirements: !ruby/object:Gem::Requirement
|
169
183
|
requirements:
|
170
184
|
- - "~>"
|
171
185
|
- !ruby/object:Gem::Version
|
172
|
-
version: '
|
186
|
+
version: '2.0'
|
173
187
|
- !ruby/object:Gem::Dependency
|
174
|
-
name:
|
188
|
+
name: codecov
|
175
189
|
requirement: !ruby/object:Gem::Requirement
|
176
190
|
requirements:
|
177
191
|
- - "~>"
|
178
192
|
- !ruby/object:Gem::Version
|
179
|
-
version:
|
193
|
+
version: 0.6.0
|
180
194
|
type: :development
|
181
195
|
prerelease: false
|
182
196
|
version_requirements: !ruby/object:Gem::Requirement
|
183
197
|
requirements:
|
184
198
|
- - "~>"
|
185
199
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
200
|
+
version: 0.6.0
|
187
201
|
- !ruby/object:Gem::Dependency
|
188
202
|
name: rack-test
|
189
203
|
requirement: !ruby/object:Gem::Requirement
|
190
204
|
requirements:
|
191
205
|
- - "~>"
|
192
206
|
- !ruby/object:Gem::Version
|
193
|
-
version: '
|
207
|
+
version: '2.0'
|
194
208
|
type: :development
|
195
209
|
prerelease: false
|
196
210
|
version_requirements: !ruby/object:Gem::Requirement
|
197
211
|
requirements:
|
198
212
|
- - "~>"
|
199
213
|
- !ruby/object:Gem::Version
|
200
|
-
version: '
|
214
|
+
version: '2.0'
|
201
215
|
- !ruby/object:Gem::Dependency
|
202
|
-
name:
|
216
|
+
name: rspec
|
203
217
|
requirement: !ruby/object:Gem::Requirement
|
204
218
|
requirements:
|
205
219
|
- - "~>"
|
206
220
|
- !ruby/object:Gem::Version
|
207
|
-
version: '
|
221
|
+
version: '3.9'
|
208
222
|
type: :development
|
209
223
|
prerelease: false
|
210
224
|
version_requirements: !ruby/object:Gem::Requirement
|
211
225
|
requirements:
|
212
226
|
- - "~>"
|
213
227
|
- !ruby/object:Gem::Version
|
214
|
-
version: '
|
228
|
+
version: '3.9'
|
215
229
|
- !ruby/object:Gem::Dependency
|
216
|
-
name:
|
230
|
+
name: simplecov
|
217
231
|
requirement: !ruby/object:Gem::Requirement
|
218
232
|
requirements:
|
219
233
|
- - "~>"
|
220
234
|
- !ruby/object:Gem::Version
|
221
|
-
version:
|
235
|
+
version: 0.21.2
|
222
236
|
type: :development
|
223
237
|
prerelease: false
|
224
238
|
version_requirements: !ruby/object:Gem::Requirement
|
225
239
|
requirements:
|
226
240
|
- - "~>"
|
227
241
|
- !ruby/object:Gem::Version
|
228
|
-
version:
|
242
|
+
version: 0.21.2
|
229
243
|
- !ruby/object:Gem::Dependency
|
230
244
|
name: rubocop
|
231
245
|
requirement: !ruby/object:Gem::Requirement
|
232
246
|
requirements:
|
233
247
|
- - "~>"
|
234
248
|
- !ruby/object:Gem::Version
|
235
|
-
version:
|
249
|
+
version: 1.35.0
|
236
250
|
type: :development
|
237
251
|
prerelease: false
|
238
252
|
version_requirements: !ruby/object:Gem::Requirement
|
239
253
|
requirements:
|
240
254
|
- - "~>"
|
241
255
|
- !ruby/object:Gem::Version
|
242
|
-
version:
|
256
|
+
version: 1.35.0
|
243
257
|
- !ruby/object:Gem::Dependency
|
244
|
-
name:
|
258
|
+
name: rubocop-performance
|
245
259
|
requirement: !ruby/object:Gem::Requirement
|
246
260
|
requirements:
|
247
261
|
- - "~>"
|
248
262
|
- !ruby/object:Gem::Version
|
249
|
-
version: '0'
|
263
|
+
version: '1.0'
|
250
264
|
type: :development
|
251
265
|
prerelease: false
|
252
266
|
version_requirements: !ruby/object:Gem::Requirement
|
253
267
|
requirements:
|
254
268
|
- - "~>"
|
255
269
|
- !ruby/object:Gem::Version
|
256
|
-
version: '0'
|
257
|
-
|
258
|
-
|
270
|
+
version: '1.0'
|
271
|
+
- !ruby/object:Gem::Dependency
|
272
|
+
name: rubocop-rspec
|
273
|
+
requirement: !ruby/object:Gem::Requirement
|
274
|
+
requirements:
|
275
|
+
- - "~>"
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: '2.0'
|
278
|
+
type: :development
|
279
|
+
prerelease: false
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
281
|
+
requirements:
|
282
|
+
- - "~>"
|
283
|
+
- !ruby/object:Gem::Version
|
284
|
+
version: '2.0'
|
285
|
+
description: |
|
286
|
+
Use controller's classes with instance methods as routing actions,
|
287
|
+
mounting its in application class.
|
259
288
|
email:
|
260
289
|
- alex.wayfer@gmail.com
|
261
|
-
executables:
|
262
|
-
- flame
|
290
|
+
executables: []
|
263
291
|
extensions: []
|
264
292
|
extra_rdoc_files: []
|
265
293
|
files:
|
266
|
-
-
|
294
|
+
- CHANGELOG.md
|
295
|
+
- LICENSE.txt
|
296
|
+
- README.md
|
267
297
|
- lib/flame.rb
|
268
298
|
- lib/flame/application.rb
|
269
|
-
- lib/flame/
|
299
|
+
- lib/flame/config.rb
|
270
300
|
- lib/flame/controller.rb
|
301
|
+
- lib/flame/controller/actions.rb
|
302
|
+
- lib/flame/controller/cookies.rb
|
271
303
|
- lib/flame/controller/path_to.rb
|
272
304
|
- lib/flame/dispatcher.rb
|
273
|
-
- lib/flame/dispatcher/cookies.rb
|
274
305
|
- lib/flame/dispatcher/request.rb
|
275
306
|
- lib/flame/dispatcher/response.rb
|
276
307
|
- lib/flame/dispatcher/routes.rb
|
277
308
|
- lib/flame/dispatcher/static.rb
|
278
309
|
- lib/flame/errors/argument_not_assigned_error.rb
|
310
|
+
- lib/flame/errors/config_file_not_found_error.rb
|
311
|
+
- lib/flame/errors/controller_not_found_error.rb
|
279
312
|
- lib/flame/errors/route_arguments_order_error.rb
|
280
313
|
- lib/flame/errors/route_extra_arguments_error.rb
|
281
314
|
- lib/flame/errors/route_not_found_error.rb
|
@@ -283,50 +316,26 @@ files:
|
|
283
316
|
- lib/flame/path.rb
|
284
317
|
- lib/flame/render.rb
|
285
318
|
- lib/flame/router.rb
|
319
|
+
- lib/flame/router/controller_finder.rb
|
286
320
|
- lib/flame/router/route.rb
|
287
321
|
- lib/flame/router/routes.rb
|
322
|
+
- lib/flame/router/routes_refine.rb
|
323
|
+
- lib/flame/router/routes_refine/mounting.rb
|
288
324
|
- lib/flame/validators.rb
|
289
325
|
- lib/flame/version.rb
|
290
326
|
- public/favicon.ico
|
291
|
-
- template/.editorconfig
|
292
|
-
- template/.gitignore
|
293
|
-
- template/.rubocop.yml
|
294
|
-
- template/Gemfile
|
295
|
-
- template/Rakefile
|
296
|
-
- template/application.rb.erb
|
297
|
-
- template/config.ru.erb
|
298
|
-
- template/config/config.rb.erb
|
299
|
-
- template/config/database.example.yml
|
300
|
-
- template/config/deploy.example.yml
|
301
|
-
- template/config/puma.rb
|
302
|
-
- template/config/sequel.rb.erb
|
303
|
-
- template/config/server.example.yml
|
304
|
-
- template/config/session.example.yml
|
305
|
-
- template/controllers/_controller.rb.erb
|
306
|
-
- template/controllers/site/_controller.rb.erb
|
307
|
-
- template/controllers/site/index_controller.rb.erb
|
308
|
-
- template/db/.keep
|
309
|
-
- template/filewatchers.yml
|
310
|
-
- template/helpers/.keep
|
311
|
-
- template/lib/.keep
|
312
|
-
- template/locales/en.yml
|
313
|
-
- template/models/.keep
|
314
|
-
- template/public/.keep
|
315
|
-
- template/server
|
316
|
-
- template/services/.keep
|
317
|
-
- template/views/.keep
|
318
|
-
- template/views/site/index.html.erb.erb
|
319
|
-
- template/views/site/layout.html.erb.erb
|
320
327
|
homepage: https://github.com/AlexWayfer/flame
|
321
328
|
licenses:
|
322
329
|
- MIT
|
323
330
|
metadata:
|
331
|
+
rubygems_mfa_required: 'true'
|
324
332
|
bug_tracker_uri: https://github.com/AlexWayfer/flame/issues
|
325
|
-
|
333
|
+
changelog_uri: https://github.com/AlexWayfer/flame/blob/v5.0.0.rc7/CHANGELOG.md
|
334
|
+
documentation_uri: http://www.rubydoc.info/gems/flame/5.0.0.rc7
|
326
335
|
homepage_uri: https://github.com/AlexWayfer/flame
|
327
336
|
source_code_uri: https://github.com/AlexWayfer/flame
|
328
337
|
wiki_uri: https://github.com/AlexWayfer/flame/wiki
|
329
|
-
post_install_message:
|
338
|
+
post_install_message:
|
330
339
|
rdoc_options: []
|
331
340
|
require_paths:
|
332
341
|
- lib
|
@@ -334,16 +343,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
334
343
|
requirements:
|
335
344
|
- - ">="
|
336
345
|
- !ruby/object:Gem::Version
|
337
|
-
version: 2.
|
346
|
+
version: '2.6'
|
347
|
+
- - "<"
|
348
|
+
- !ruby/object:Gem::Version
|
349
|
+
version: '4'
|
338
350
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
339
351
|
requirements:
|
340
352
|
- - ">"
|
341
353
|
- !ruby/object:Gem::Version
|
342
354
|
version: 1.3.1
|
343
355
|
requirements: []
|
344
|
-
|
345
|
-
|
346
|
-
signing_key:
|
356
|
+
rubygems_version: 3.3.7
|
357
|
+
signing_key:
|
347
358
|
specification_version: 4
|
348
359
|
summary: Web-framework, based on MVC-pattern
|
349
360
|
test_files: []
|
data/bin/flame
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'thor'
|
5
|
-
|
6
|
-
require_relative 'new'
|
7
|
-
|
8
|
-
module FlameCLI
|
9
|
-
## CLI Application
|
10
|
-
class Flame < Thor
|
11
|
-
desc 'new ENTITY ...ARGS', 'create new entity'
|
12
|
-
subcommand 'new', New
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
FlameCLI::Flame.start(ARGV)
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Flame
|
4
|
-
class Application
|
5
|
-
## Class for Flame::Application.config
|
6
|
-
class Config < Hash
|
7
|
-
## Create an instance of application config
|
8
|
-
## @param app [Flame::Application] application
|
9
|
-
## @param hash [Hash] config content
|
10
|
-
def initialize(app, hash = {})
|
11
|
-
@app = app
|
12
|
-
replace(hash)
|
13
|
-
end
|
14
|
-
|
15
|
-
## Get config value by key
|
16
|
-
## @param key [Symbol] config key
|
17
|
-
## @return [Object] config value
|
18
|
-
def [](key)
|
19
|
-
result = super(key)
|
20
|
-
if result.class <= Proc && result.parameters.empty?
|
21
|
-
result = @app.class_exec(&result)
|
22
|
-
end
|
23
|
-
result
|
24
|
-
end
|
25
|
-
|
26
|
-
## Method for loading YAML-files from config directory
|
27
|
-
## @param file [String, Symbol] file name (typecast to String with '.yml')
|
28
|
-
## @param key [Symbol, String, nil]
|
29
|
-
## key for allocating YAML in config Hash (typecast to Symbol)
|
30
|
-
## @param set [Boolean] allocating YAML in Config Hash
|
31
|
-
## @example Load SMTP file from `config/smtp.yml' to config[]
|
32
|
-
## config.load_yaml('smtp.yml')
|
33
|
-
## @example Load SMTP file without extension, by Symbol
|
34
|
-
## config.load_yaml(:smtp)
|
35
|
-
## @example Load SMTP file with other key to config[:mail]
|
36
|
-
## config.load_yaml('smtp.yml', key: :mail)
|
37
|
-
## @example Load SMTP file without allocating in config[]
|
38
|
-
## config.load_yaml('smtp.yml', set: false)
|
39
|
-
def load_yaml(file, key: nil, set: true)
|
40
|
-
file = "#{file}.yml" if file.is_a? Symbol
|
41
|
-
file_path = File.join(self[:config_dir], file)
|
42
|
-
yaml = YAML.load_file(file_path)
|
43
|
-
key ||= File.basename(file, '.*')
|
44
|
-
self[key.to_sym] = yaml if set
|
45
|
-
yaml
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
data/template/.editorconfig
DELETED
data/template/.gitignore
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# configuration
|
2
|
-
config/**/*
|
3
|
-
!config/**/*.example*
|
4
|
-
!config/**/*.rb
|
5
|
-
!config/**/*.erb
|
6
|
-
!config/nginx
|
7
|
-
!config/nginx/snippets
|
8
|
-
!config/nginx/snippets/*.example*
|
9
|
-
!config/nginx/snippets/ssl-params.conf
|
10
|
-
!config/nginx/sites
|
11
|
-
!config/nginx/sites/*.example*
|
12
|
-
|
13
|
-
# temp
|
14
|
-
.sass-cache/
|
15
|
-
log/
|
16
|
-
tmp/
|
17
|
-
*.bak
|
18
|
-
*~
|
19
|
-
|
20
|
-
# uploaded files
|
21
|
-
#public/files
|
22
|
-
|
23
|
-
# dumps
|
24
|
-
*.sql
|
25
|
-
|
26
|
-
# seo files
|
27
|
-
#views/site/sitemap.html
|
28
|
-
#public/robots.txt
|
data/template/.rubocop.yml
DELETED
data/template/Gemfile
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
## https://github.com/bundler/bundler/issues/4978
|
6
|
-
git_source(:github) { |name| "https://github.com/#{name}.git" }
|
7
|
-
|
8
|
-
## system
|
9
|
-
# gem 'gorilla_patch'
|
10
|
-
|
11
|
-
## server
|
12
|
-
gem 'flame', github: 'AlexWayfer/flame'
|
13
|
-
# gem 'flame-flash', github: 'AlexWayfer/flame-flash'
|
14
|
-
gem 'puma'
|
15
|
-
# gem 'rack-slashenforce'
|
16
|
-
gem 'rack-utf8_sanitizer'
|
17
|
-
# gem 'rack_csrf', require: 'rack/csrf'
|
18
|
-
|
19
|
-
group :development do
|
20
|
-
gem 'filewatcher'
|
21
|
-
gem 'pry-byebug'
|
22
|
-
end
|
23
|
-
|
24
|
-
group :linter do
|
25
|
-
# gem 'rubocop'
|
26
|
-
end
|
27
|
-
|
28
|
-
## database
|
29
|
-
# gem 'pg'
|
30
|
-
# gem 'sequel'
|
31
|
-
# gem 'sequel_pg', require: 'sequel'
|
32
|
-
|
33
|
-
## translations
|
34
|
-
# gem 'flame-r18n', github: 'AlexWayfer/flame-r18n'
|
35
|
-
## for named_variables filter
|
36
|
-
# gem 'r18n-rails-api'
|
37
|
-
|
38
|
-
## views
|
39
|
-
gem 'erubi', require: 'tilt/erubi'
|
40
|
-
|
41
|
-
## assets
|
42
|
-
# gem 'sass'
|
43
|
-
|
44
|
-
## others
|
45
|
-
# gem 'faker'
|
46
|
-
# gem 'google_currency'
|
47
|
-
# gem 'kramdown'
|
48
|
-
# gem 'mail'
|
49
|
-
# gem 'money'
|
50
|
-
# gem 'sentry-raven'
|
51
|
-
|
52
|
-
## tools
|
53
|
-
gem 'pry'
|
54
|
-
gem 'rack-console'
|
55
|
-
gem 'rake'
|