miscellany 0.1.2 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miscellany/active_record/arbitrary_prefetch.rb +40 -17
- data/lib/miscellany/active_record/batched_destruction.rb +0 -1
- data/lib/miscellany/active_record/computed_columns.rb +107 -0
- data/lib/miscellany/batch_processor.rb +7 -3
- data/lib/miscellany/controller/sliced_response.rb +35 -8
- data/lib/miscellany/param_validator.rb +133 -86
- data/lib/miscellany/version.rb +1 -1
- data/lib/miscellany.rb +8 -0
- data/miscellany.gemspec +8 -17
- data/spec/db/database.yml +3 -0
- data/spec/miscellany/arbitrary_prefetch_spec.rb +69 -0
- data/spec/miscellany/computed_columns_spec.rb +62 -0
- data/spec/miscellany/param_validator_spec.rb +295 -0
- data/spec/spec_helper.rb +42 -0
- metadata +38 -179
- data/app/views/miscellany/spa_page.html.erb +0 -2
- data/config/initializers/01_custom_preloaders.rb +0 -2
- data/config/initializers/arbitrary_prefetch.rb +0 -1
- data/lib/miscellany/controller/spa_render.rb +0 -18
metadata
CHANGED
@@ -1,157 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miscellany
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan Knapp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.15'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.15'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec-rails
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pg
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: factory
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: factory_bot
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: timecop
|
14
|
+
name: rails
|
113
15
|
requirement: !ruby/object:Gem::Requirement
|
114
16
|
requirements:
|
115
17
|
- - ">="
|
116
18
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
118
|
-
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: webmock
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
19
|
+
version: '5'
|
20
|
+
- - "<"
|
130
21
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
132
|
-
type: :
|
22
|
+
version: '6.3'
|
23
|
+
type: :runtime
|
133
24
|
prerelease: false
|
134
25
|
version_requirements: !ruby/object:Gem::Requirement
|
135
26
|
requirements:
|
136
27
|
- - ">="
|
137
28
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
139
|
-
-
|
140
|
-
name: sinatra
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
29
|
+
version: '5'
|
30
|
+
- - "<"
|
151
31
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
32
|
+
version: '6.3'
|
153
33
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
34
|
+
name: rake
|
155
35
|
requirement: !ruby/object:Gem::Requirement
|
156
36
|
requirements:
|
157
37
|
- - ">="
|
@@ -165,49 +45,49 @@ dependencies:
|
|
165
45
|
- !ruby/object:Gem::Version
|
166
46
|
version: '0'
|
167
47
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
48
|
+
name: database_cleaner
|
169
49
|
requirement: !ruby/object:Gem::Requirement
|
170
50
|
requirements:
|
171
51
|
- - ">="
|
172
52
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
53
|
+
version: '1.2'
|
174
54
|
type: :development
|
175
55
|
prerelease: false
|
176
56
|
version_requirements: !ruby/object:Gem::Requirement
|
177
57
|
requirements:
|
178
58
|
- - ">="
|
179
59
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
60
|
+
version: '1.2'
|
181
61
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
62
|
+
name: rspec
|
183
63
|
requirement: !ruby/object:Gem::Requirement
|
184
64
|
requirements:
|
185
|
-
- - "
|
65
|
+
- - "~>"
|
186
66
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
67
|
+
version: '3'
|
188
68
|
type: :development
|
189
69
|
prerelease: false
|
190
70
|
version_requirements: !ruby/object:Gem::Requirement
|
191
71
|
requirements:
|
192
|
-
- - "
|
72
|
+
- - "~>"
|
193
73
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
74
|
+
version: '3'
|
195
75
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
76
|
+
name: sqlite3
|
197
77
|
requirement: !ruby/object:Gem::Requirement
|
198
78
|
requirements:
|
199
|
-
- - "
|
79
|
+
- - "~>"
|
200
80
|
- !ruby/object:Gem::Version
|
201
|
-
version: '
|
81
|
+
version: '1.3'
|
202
82
|
type: :development
|
203
83
|
prerelease: false
|
204
84
|
version_requirements: !ruby/object:Gem::Requirement
|
205
85
|
requirements:
|
206
|
-
- - "
|
86
|
+
- - "~>"
|
207
87
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
88
|
+
version: '1.3'
|
209
89
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
90
|
+
name: with_model
|
211
91
|
requirement: !ruby/object:Gem::Requirement
|
212
92
|
requirements:
|
213
93
|
- - ">="
|
@@ -220,34 +100,6 @@ dependencies:
|
|
220
100
|
- - ">="
|
221
101
|
- !ruby/object:Gem::Version
|
222
102
|
version: '0'
|
223
|
-
- !ruby/object:Gem::Dependency
|
224
|
-
name: rails
|
225
|
-
requirement: !ruby/object:Gem::Requirement
|
226
|
-
requirements:
|
227
|
-
- - ">="
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: '5'
|
230
|
-
type: :runtime
|
231
|
-
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
requirements:
|
234
|
-
- - ">="
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: '5'
|
237
|
-
- !ruby/object:Gem::Dependency
|
238
|
-
name: activerecord-import
|
239
|
-
requirement: !ruby/object:Gem::Requirement
|
240
|
-
requirements:
|
241
|
-
- - ">="
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: '0'
|
244
|
-
type: :runtime
|
245
|
-
prerelease: false
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
247
|
-
requirements:
|
248
|
-
- - ">="
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: '0'
|
251
103
|
description:
|
252
104
|
email:
|
253
105
|
- eknapp@instructure.com
|
@@ -256,24 +108,26 @@ extensions: []
|
|
256
108
|
extra_rdoc_files: []
|
257
109
|
files:
|
258
110
|
- README.md
|
259
|
-
- app/views/miscellany/spa_page.html.erb
|
260
|
-
- config/initializers/01_custom_preloaders.rb
|
261
|
-
- config/initializers/arbitrary_prefetch.rb
|
262
111
|
- config/initializers/cancancan.rb
|
263
112
|
- lib/miscellany.rb
|
264
113
|
- lib/miscellany/active_record/arbitrary_prefetch.rb
|
265
114
|
- lib/miscellany/active_record/batch_matcher.rb
|
266
115
|
- lib/miscellany/active_record/batched_destruction.rb
|
116
|
+
- lib/miscellany/active_record/computed_columns.rb
|
267
117
|
- lib/miscellany/active_record/custom_preloaders.rb
|
268
118
|
- lib/miscellany/batch_processor.rb
|
269
119
|
- lib/miscellany/batching_csv_processor.rb
|
270
120
|
- lib/miscellany/controller/http_error_handling.rb
|
271
121
|
- lib/miscellany/controller/json_uploads.rb
|
272
122
|
- lib/miscellany/controller/sliced_response.rb
|
273
|
-
- lib/miscellany/controller/spa_render.rb
|
274
123
|
- lib/miscellany/param_validator.rb
|
275
124
|
- lib/miscellany/version.rb
|
276
125
|
- miscellany.gemspec
|
126
|
+
- spec/db/database.yml
|
127
|
+
- spec/miscellany/arbitrary_prefetch_spec.rb
|
128
|
+
- spec/miscellany/computed_columns_spec.rb
|
129
|
+
- spec/miscellany/param_validator_spec.rb
|
130
|
+
- spec/spec_helper.rb
|
277
131
|
homepage: https://instructure.com
|
278
132
|
licenses: []
|
279
133
|
metadata: {}
|
@@ -292,8 +146,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
146
|
- !ruby/object:Gem::Version
|
293
147
|
version: '0'
|
294
148
|
requirements: []
|
295
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.1.6
|
296
150
|
signing_key:
|
297
151
|
specification_version: 4
|
298
152
|
summary: Gem for a bunch of random, re-usable Rails Concerns & Helpers
|
299
|
-
test_files:
|
153
|
+
test_files:
|
154
|
+
- spec/db/database.yml
|
155
|
+
- spec/miscellany/arbitrary_prefetch_spec.rb
|
156
|
+
- spec/miscellany/param_validator_spec.rb
|
157
|
+
- spec/miscellany/computed_columns_spec.rb
|
158
|
+
- spec/spec_helper.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
Miscellany::ArbitraryPrefetch.install
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Miscellany
|
2
|
-
module SpaRender
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
def render(*args, **kwargs)
|
6
|
-
if kwargs[:spa].present?
|
7
|
-
js_env(kwargs.delete(:env))
|
8
|
-
kwargs[:template] ||= 'miscellany/spa_page'
|
9
|
-
kwargs[:locals] ||= {}
|
10
|
-
kwargs[:locals][:pack_name] ||= kwargs.delete(:spa)
|
11
|
-
kwargs[:formats] = [:html]
|
12
|
-
super(*args, **kwargs)
|
13
|
-
else
|
14
|
-
super
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|