arxutils_sqlite3 0.1.52 → 0.1.54
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 +4 -4
- data/.rubocop_todo.yml +25 -355
- data/Gemfile +1 -1
- data/Gemfile.lock +3 -3
- data/config/setting.yml +1 -1
- data/exe/arxutils_sqlite3 +9 -26
- data/lib/arxutils_sqlite3/cli.rb +21 -6
- data/lib/arxutils_sqlite3/config.rb +67 -32
- data/lib/arxutils_sqlite3/dbutil/dbconnect.rb +2 -2
- data/lib/arxutils_sqlite3/migrate.rb +17 -10
- data/lib/arxutils_sqlite3/rake_task.rb +28 -14
- data/lib/arxutils_sqlite3/version.rb +1 -1
- data/lib/dbacrecord.rb +9 -9
- data/lib/template/acrecord/acrecord_invalid.tmpl +2 -2
- data/lib/template/acrecord/db_scheme/db_scheme.yml +6 -6
- data/lib/template/acrecord/db_scheme/dbsetup.tmpl +4 -2
- data/lib/template/acrecord/db_scheme/opts.rb.sample +1 -1
- metadata +2 -3
- data/lib/template/acrecord/db_scheme/db_scheme.yml.sample +0 -48
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63b6c2964eb5bd59b6601706fdb9085d50353be9df04ba6b83995e1c9b617707
|
|
4
|
+
data.tar.gz: 3c366bd4cddb2287a82ad9f184a465c9953323699108eab8849ecadb10f8f11f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9c7c00307a6063f7254478e8879a0f883b4bb369533cb738dadbb964723cc24f7460e1684e9ae61b201567f3a13f48c8cb0e357999c7cdc99224cb9d6d9acb8
|
|
7
|
+
data.tar.gz: 0f2c860830b7568161cede9212427412d1e9babe3426429541e425f5e032695976c2e8e91657c81f90e1ff47583f4920efadb37cb2c978da09c302d92b04aaa5
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,319 +1,64 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2022-09-
|
|
3
|
+
# on 2022-09-23 07:28:29 UTC using RuboCop version 1.36.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count: 2
|
|
10
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
|
|
12
|
-
# Include: **/*.gemspec
|
|
13
|
-
Gemspec/OrderedDependencies:
|
|
14
|
-
Exclude:
|
|
15
|
-
#- 'arxutils_sqlite3.gemspec'
|
|
16
|
-
|
|
17
|
-
# Offense count: 1
|
|
18
|
-
# Configuration parameters: Include.
|
|
19
|
-
# Include: **/*.gemspec
|
|
20
|
-
Gemspec/RequiredRubyVersion:
|
|
21
|
-
Exclude:
|
|
22
|
-
#- 'arxutils_sqlite3.gemspec'
|
|
23
|
-
|
|
24
|
-
# Offense count: 2
|
|
25
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
26
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
27
|
-
# SupportedStyles: with_first_element, with_fixed_indentation
|
|
28
|
-
Layout/ArrayAlignment:
|
|
29
|
-
Exclude:
|
|
30
|
-
#- 'lib/arxutils_sqlite3/migrate.rb'
|
|
31
|
-
|
|
32
|
-
# Offense count: 1
|
|
33
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
34
|
-
Layout/BlockEndNewline:
|
|
35
|
-
Exclude:
|
|
36
|
-
#- 'lib/arxutils_sqlite3/migrate.rb'
|
|
37
|
-
|
|
38
|
-
# Offense count: 1
|
|
39
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
40
|
-
# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
|
|
41
|
-
# SupportedStyles: case, end
|
|
42
|
-
Layout/CaseIndentation:
|
|
43
|
-
Exclude:
|
|
44
|
-
#- 'lib/arxutils_sqlite3/migrate.rb'
|
|
45
|
-
|
|
46
|
-
# Offense count: 1
|
|
47
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
48
|
-
Layout/ClosingParenthesisIndentation:
|
|
49
|
-
Exclude:
|
|
50
|
-
#- 'lib/arxutils_sqlite3/migrate.rb'
|
|
51
|
-
|
|
52
|
-
# Offense count: 4
|
|
53
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
54
|
-
# Configuration parameters: AllowForAlignment.
|
|
55
|
-
Layout/CommentIndentation:
|
|
56
|
-
Exclude:
|
|
57
|
-
#- 'Gemfile'
|
|
58
|
-
#- 'lib/arxutils_sqlite3/migrate.rb'
|
|
59
|
-
|
|
60
|
-
# Offense count: 1
|
|
61
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
62
|
-
# Configuration parameters: AllowBorderComment, AllowMarginComment.
|
|
63
|
-
Layout/EmptyComment:
|
|
64
|
-
Exclude:
|
|
65
|
-
# - 'lib/arxutils_sqlite3/dbutil.rb'
|
|
66
|
-
|
|
67
|
-
# Offense count: 1
|
|
68
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
69
|
-
Layout/EmptyLineAfterMagicComment:
|
|
70
|
-
Exclude:
|
|
71
|
-
# - 'lib/arxutils_sqlite3.rb'
|
|
72
|
-
|
|
73
|
-
# Offense count: 1
|
|
74
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
75
|
-
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
|
|
76
|
-
Layout/EmptyLineBetweenDefs:
|
|
77
|
-
Exclude:
|
|
78
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
79
|
-
|
|
80
|
-
# Offense count: 2
|
|
81
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
82
|
-
Layout/EmptyLines:
|
|
83
|
-
Exclude:
|
|
84
|
-
# - 'lib/arxutils_sqlite3_rake_task.rb'
|
|
85
|
-
|
|
86
|
-
# Offense count: 1
|
|
87
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
88
|
-
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
|
|
89
|
-
# AllowedMethods: alias_method, public, protected, private
|
|
90
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
|
91
|
-
Exclude:
|
|
92
|
-
# - 'lib/arxutils_sqlite3/migrate.rb'
|
|
93
|
-
|
|
94
|
-
# Offense count: 1
|
|
95
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
96
|
-
# Configuration parameters: EnforcedStyle.
|
|
97
|
-
# SupportedStyles: empty_lines, no_empty_lines
|
|
98
|
-
Layout/EmptyLinesAroundBlockBody:
|
|
99
|
-
Exclude:
|
|
100
|
-
# - 'Gemfile'
|
|
101
|
-
|
|
102
9
|
# Offense count: 1
|
|
103
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
104
11
|
# Configuration parameters: EnforcedStyle.
|
|
105
12
|
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
|
|
106
13
|
Layout/EmptyLinesAroundModuleBody:
|
|
107
14
|
Exclude:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
# Offense count: 1
|
|
111
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
112
|
-
# Configuration parameters: EnforcedStyleAlignWith, Severity.
|
|
113
|
-
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
|
114
|
-
Layout/EndAlignment:
|
|
115
|
-
Exclude:
|
|
116
|
-
# - 'lib/arxutils_sqlite3/migrate.rb'
|
|
117
|
-
|
|
118
|
-
# Offense count: 3
|
|
119
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
120
|
-
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
|
|
121
|
-
Layout/ExtraSpacing:
|
|
122
|
-
Exclude:
|
|
123
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
15
|
+
- 'lib/dbacrecord.rb'
|
|
124
16
|
|
|
125
17
|
# Offense count: 1
|
|
126
18
|
# This cop supports safe autocorrection (--autocorrect).
|
|
127
19
|
Layout/HeredocIndentation:
|
|
128
20
|
Exclude:
|
|
129
|
-
|
|
21
|
+
- 'db/migrate/050_create_currentxenoplist.rb'
|
|
130
22
|
|
|
131
23
|
# Offense count: 1
|
|
132
24
|
# This cop supports safe autocorrection (--autocorrect).
|
|
133
|
-
# Configuration parameters: IndentationWidth, EnforcedStyle.
|
|
134
|
-
# SupportedStyles: spaces, tabs
|
|
135
|
-
Layout/IndentationStyle:
|
|
136
|
-
Exclude:
|
|
137
|
-
# - 'Gemfile'
|
|
138
|
-
|
|
139
|
-
# Offense count: 2
|
|
140
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
141
25
|
# Configuration parameters: Width, AllowedPatterns, IgnoredPatterns.
|
|
142
26
|
Layout/IndentationWidth:
|
|
143
27
|
Exclude:
|
|
144
|
-
|
|
145
|
-
# - 'lib/dbacrecord.rb'
|
|
146
|
-
|
|
147
|
-
# Offense count: 29
|
|
148
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
149
|
-
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
|
|
150
|
-
Layout/LeadingCommentSpace:
|
|
151
|
-
Exclude:
|
|
152
|
-
# - 'Gemfile'
|
|
153
|
-
# - 'Rakefile'
|
|
154
|
-
# - 'arxutils_sqlite3.gemspec'
|
|
155
|
-
# - 'exe/arxutils_sqlite3'
|
|
156
|
-
# - 'lib/arxutils_sqlite3/arx.rb'
|
|
157
|
-
# - 'lib/arxutils_sqlite3/cli.rb'
|
|
158
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
159
|
-
# - 'lib/arxutils_sqlite3/dbutil/dbconnect.rb'
|
|
160
|
-
# - 'lib/arxutils_sqlite3/migrate.rb'
|
|
161
|
-
|
|
162
|
-
# Offense count: 1
|
|
163
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
164
|
-
Layout/LeadingEmptyLines:
|
|
165
|
-
Exclude:
|
|
166
|
-
# - 'lib/arxutils_sqlite3_rake_task.rb'
|
|
167
|
-
|
|
168
|
-
# Offense count: 1
|
|
169
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
170
|
-
# Configuration parameters: EnforcedStyle.
|
|
171
|
-
# SupportedStyles: symmetrical, new_line, same_line
|
|
172
|
-
Layout/MultilineArrayBraceLayout:
|
|
173
|
-
Exclude:
|
|
174
|
-
# - 'lib/arxutils_sqlite3/migrate.rb'
|
|
175
|
-
|
|
176
|
-
# Offense count: 1
|
|
177
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
178
|
-
Layout/MultilineBlockLayout:
|
|
179
|
-
Exclude:
|
|
180
|
-
# - 'lib/arxutils_sqlite3/migrate.rb'
|
|
181
|
-
|
|
182
|
-
# Offense count: 2
|
|
183
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
184
|
-
# Configuration parameters: EnforcedStyle.
|
|
185
|
-
# SupportedStyles: symmetrical, new_line, same_line
|
|
186
|
-
Layout/MultilineMethodCallBraceLayout:
|
|
187
|
-
Exclude:
|
|
188
|
-
# - 'lib/arxutils_sqlite3/migrate.rb'
|
|
189
|
-
# - 'lib/arxutils_sqlite3/util.rb'
|
|
28
|
+
- 'lib/dbacrecord.rb'
|
|
190
29
|
|
|
191
30
|
# Offense count: 3
|
|
192
31
|
# This cop supports safe autocorrection (--autocorrect).
|
|
193
|
-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
|
194
|
-
# SupportedStyles: space, no_space
|
|
195
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
|
196
|
-
Layout/SpaceBeforeBlockBraces:
|
|
197
|
-
Exclude:
|
|
198
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
199
|
-
|
|
200
|
-
# Offense count: 9
|
|
201
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
202
32
|
Layout/SpaceBeforeComma:
|
|
203
33
|
Exclude:
|
|
204
|
-
# - 'Gemfile'
|
|
205
|
-
# - 'arxutils_sqlite3.gemspec'
|
|
206
|
-
# - 'lib/arxutils_sqlite3/arx.rb'
|
|
207
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
208
34
|
# - 'lib/dbacrecord.rb'
|
|
209
|
-
# - 'spec/arxutils__sqlite3_spec.rb'
|
|
210
35
|
|
|
211
|
-
# Offense count:
|
|
212
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
213
|
-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
|
214
|
-
# SupportedStyles: space, no_space
|
|
215
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
|
216
|
-
Layout/SpaceInsideBlockBraces:
|
|
217
|
-
Exclude:
|
|
218
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
219
|
-
|
|
220
|
-
# Offense count: 4
|
|
221
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
222
|
-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
|
223
|
-
# SupportedStyles: space, no_space, compact
|
|
224
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
|
225
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
226
|
-
Exclude:
|
|
227
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
228
|
-
|
|
229
|
-
# Offense count: 12
|
|
36
|
+
# Offense count: 2
|
|
230
37
|
# This cop supports safe autocorrection (--autocorrect).
|
|
231
38
|
# Configuration parameters: EnforcedStyle.
|
|
232
39
|
# SupportedStyles: space, compact, no_space
|
|
233
40
|
Layout/SpaceInsideParens:
|
|
234
41
|
Exclude:
|
|
235
42
|
# - 'config/dbsetup.rb'
|
|
236
|
-
# - 'lib/arxutils_sqlite3/cli.rb'
|
|
237
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
238
43
|
|
|
239
|
-
# Offense count:
|
|
240
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
241
|
-
# Configuration parameters: EnforcedStyle.
|
|
242
|
-
# SupportedStyles: final_newline, final_blank_line
|
|
243
|
-
Layout/TrailingEmptyLines:
|
|
244
|
-
Exclude:
|
|
245
|
-
# - 'Gemfile'
|
|
246
|
-
# - 'Rakefile'
|
|
247
|
-
# - 'lib/arxutils_sqlite3.rb'
|
|
248
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
249
|
-
# - 'lib/arxutils_sqlite3_rake_task.rb'
|
|
250
|
-
|
|
251
|
-
# Offense count: 3
|
|
44
|
+
# Offense count: 1
|
|
252
45
|
# This cop supports safe autocorrection (--autocorrect).
|
|
253
46
|
# Configuration parameters: AllowInHeredoc.
|
|
254
47
|
Layout/TrailingWhitespace:
|
|
255
48
|
Exclude:
|
|
256
|
-
|
|
257
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
258
|
-
# - 'spec/arxutils__sqlite3_spec.rb'
|
|
259
|
-
|
|
260
|
-
# Offense count: 1
|
|
261
|
-
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
|
262
|
-
Lint/EmptyBlock:
|
|
263
|
-
Exclude:
|
|
264
|
-
# - 'Gemfile'
|
|
265
|
-
|
|
266
|
-
# Offense count: 1
|
|
267
|
-
Lint/NestedPercentLiteral:
|
|
268
|
-
Exclude:
|
|
269
|
-
# - 'lib/template/acrecord/db_scheme/opts.rb'
|
|
270
|
-
|
|
271
|
-
# Offense count: 1
|
|
272
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
273
|
-
Lint/ScriptPermission:
|
|
274
|
-
Exclude:
|
|
275
|
-
# - 'lib/arxutils_sqlite3/dbutil/dbconnect.rb'
|
|
276
|
-
|
|
277
|
-
# Offense count: 1
|
|
278
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
279
|
-
# Configuration parameters: EnforcedStyle.
|
|
280
|
-
# SupportedStyles: strict, consistent
|
|
281
|
-
Lint/SymbolConversion:
|
|
282
|
-
Exclude:
|
|
283
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
284
|
-
|
|
285
|
-
# Offense count: 2
|
|
286
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
287
|
-
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
|
|
288
|
-
Lint/UnusedMethodArgument:
|
|
289
|
-
Exclude:
|
|
290
|
-
# - 'lib/arxutils_sqlite3/cli.rb'
|
|
291
|
-
|
|
292
|
-
# Offense count: 13
|
|
293
|
-
Lint/UselessAssignment:
|
|
294
|
-
Exclude:
|
|
295
|
-
# - 'exe/arxutils_sqlite3'
|
|
296
|
-
# - 'lib/arxutils_sqlite3/cli.rb'
|
|
297
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
298
|
-
# - 'lib/arxutils_sqlite3/hier.rb'
|
|
299
|
-
# - 'spec/arxutils__sqlite3_spec.rb'
|
|
49
|
+
- 'db/migrate/050_create_currentxenoplist.rb'
|
|
300
50
|
|
|
301
51
|
# Offense count: 4
|
|
302
52
|
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
|
|
303
53
|
Metrics/AbcSize:
|
|
304
|
-
Max:
|
|
54
|
+
Max: 23
|
|
305
55
|
|
|
306
56
|
# Offense count: 3
|
|
307
57
|
# Configuration parameters: CountComments, CountAsOne.
|
|
308
58
|
Metrics/ClassLength:
|
|
309
|
-
Max:
|
|
310
|
-
|
|
311
|
-
# Offense count: 1
|
|
312
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
|
|
313
|
-
Metrics/CyclomaticComplexity:
|
|
314
|
-
Max: 8
|
|
59
|
+
Max: 192
|
|
315
60
|
|
|
316
|
-
# Offense count:
|
|
61
|
+
# Offense count: 11
|
|
317
62
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
|
318
63
|
Metrics/MethodLength:
|
|
319
64
|
Max: 49
|
|
@@ -328,11 +73,6 @@ Metrics/ParameterLists:
|
|
|
328
73
|
Metrics/PerceivedComplexity:
|
|
329
74
|
Max: 10
|
|
330
75
|
|
|
331
|
-
# Offense count: 10
|
|
332
|
-
Naming/AccessorMethodName:
|
|
333
|
-
Exclude:
|
|
334
|
-
- 'lib/arxutils_sqlite3/config.rb'
|
|
335
|
-
|
|
336
76
|
# Offense count: 11
|
|
337
77
|
# Configuration parameters: AllowedNames.
|
|
338
78
|
# AllowedNames: module_parent
|
|
@@ -350,27 +90,10 @@ Naming/ClassAndModuleCamelCase:
|
|
|
350
90
|
- 'lib/arxutils_sqlite3/util.rb'
|
|
351
91
|
- 'lib/arxutils_sqlite3/version.rb'
|
|
352
92
|
|
|
353
|
-
# Offense count: 4
|
|
354
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
355
|
-
# Configuration parameters: PreferredName.
|
|
356
|
-
Naming/RescuedExceptionsVariableName:
|
|
357
|
-
Exclude:
|
|
358
|
-
- 'exe/arxutils_sqlite3'
|
|
359
|
-
- 'lib/arxutils_sqlite3/config.rb'
|
|
360
|
-
- 'lib/arxutils_sqlite3/dbutil/dbconnect.rb'
|
|
361
|
-
|
|
362
93
|
# Offense count: 1
|
|
363
|
-
# Configuration parameters:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
Naming/VariableNumber:
|
|
367
|
-
Exclude:
|
|
368
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
369
|
-
|
|
370
|
-
# Offense count: 2
|
|
371
|
-
# Configuration parameters: CountAsOne.
|
|
372
|
-
RSpec/ExampleLength:
|
|
373
|
-
Max: 7
|
|
94
|
+
# Configuration parameters: AllowSubject.
|
|
95
|
+
RSpec/MultipleMemoizedHelpers:
|
|
96
|
+
Max: 11
|
|
374
97
|
|
|
375
98
|
# Offense count: 1
|
|
376
99
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -378,18 +101,6 @@ Style/BlockComments:
|
|
|
378
101
|
Exclude:
|
|
379
102
|
# - 'config/dbsetup.rb'
|
|
380
103
|
|
|
381
|
-
# Offense count: 4
|
|
382
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
383
|
-
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
|
384
|
-
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
|
385
|
-
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
|
386
|
-
# FunctionalMethods: let, let!, subject, watch
|
|
387
|
-
# AllowedMethods: lambda, proc, it
|
|
388
|
-
Style/BlockDelimiters:
|
|
389
|
-
Exclude:
|
|
390
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
391
|
-
# - 'lib/arxutils_sqlite3/migrate.rb'
|
|
392
|
-
|
|
393
104
|
# Offense count: 7
|
|
394
105
|
# Configuration parameters: AllowedConstants.
|
|
395
106
|
Style/Documentation:
|
|
@@ -398,17 +109,17 @@ Style/Documentation:
|
|
|
398
109
|
- 'test/**/*'
|
|
399
110
|
- 'config/dbsetup.rb'
|
|
400
111
|
- 'db/migrate/010_create_countdatetime.rb'
|
|
401
|
-
- 'db/migrate/
|
|
402
|
-
- 'db/migrate/
|
|
403
|
-
- 'db/migrate/
|
|
404
|
-
- 'db/migrate/
|
|
112
|
+
- 'db/migrate/020_create_xenop.rb'
|
|
113
|
+
- 'db/migrate/030_create_xenoplist.rb'
|
|
114
|
+
- 'db/migrate/040_create_invalidxenoplist.rb'
|
|
115
|
+
- 'db/migrate/050_create_currentxenoplist.rb'
|
|
405
116
|
- 'lib/arxutils_sqlite3/util.rb'
|
|
406
117
|
|
|
407
|
-
# Offense count:
|
|
118
|
+
# Offense count: 2
|
|
408
119
|
# This cop supports safe autocorrection (--autocorrect).
|
|
409
|
-
Style/
|
|
120
|
+
Style/EmptyLiteral:
|
|
410
121
|
Exclude:
|
|
411
|
-
# - '
|
|
122
|
+
# - 'config/dbsetup.rb'
|
|
412
123
|
|
|
413
124
|
# Offense count: 5
|
|
414
125
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -424,12 +135,6 @@ Style/FormatStringToken:
|
|
|
424
135
|
Style/FrozenStringLiteralComment:
|
|
425
136
|
Enabled: false
|
|
426
137
|
|
|
427
|
-
# Offense count: 5
|
|
428
|
-
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
|
|
429
|
-
Style/GuardClause:
|
|
430
|
-
Exclude:
|
|
431
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
432
|
-
|
|
433
138
|
# Offense count: 10
|
|
434
139
|
# This cop supports safe autocorrection (--autocorrect).
|
|
435
140
|
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
|
@@ -438,50 +143,15 @@ Style/GuardClause:
|
|
|
438
143
|
Style/HashSyntax:
|
|
439
144
|
Exclude:
|
|
440
145
|
# - 'db/migrate/010_create_countdatetime.rb'
|
|
441
|
-
# - 'db/migrate/
|
|
442
|
-
# - 'db/migrate/
|
|
443
|
-
# - 'db/migrate/
|
|
146
|
+
# - 'db/migrate/020_create_xenop.rb'
|
|
147
|
+
# - 'db/migrate/030_create_xenoplist.rb'
|
|
148
|
+
# - 'db/migrate/040_create_invalidxenoplist.rb'
|
|
444
149
|
|
|
445
|
-
# Offense count:
|
|
446
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
447
|
-
Style/IfUnlessModifier:
|
|
448
|
-
Exclude:
|
|
449
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
450
|
-
|
|
451
|
-
# Offense count: 3
|
|
452
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
453
|
-
# Configuration parameters: EnforcedStyle.
|
|
454
|
-
# SupportedStyles: both, prefix, postfix
|
|
455
|
-
Style/NegatedIf:
|
|
456
|
-
Exclude:
|
|
457
|
-
# - 'lib/arxutils_sqlite3/config.rb'
|
|
458
|
-
|
|
459
|
-
# Offense count: 1
|
|
460
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
461
|
-
Style/RedundantCondition:
|
|
462
|
-
Exclude:
|
|
463
|
-
# - 'exe/arxutils_sqlite3'
|
|
464
|
-
|
|
465
|
-
# Offense count: 1
|
|
466
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
467
|
-
Style/RedundantInterpolation:
|
|
468
|
-
Exclude:
|
|
469
|
-
# - 'exe/arxutils_sqlite3'
|
|
470
|
-
|
|
471
|
-
# Offense count: 1
|
|
472
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
473
|
-
# Configuration parameters: EnforcedStyle.
|
|
474
|
-
# SupportedStyles: implicit, explicit
|
|
475
|
-
Style/RescueStandardError:
|
|
476
|
-
Exclude:
|
|
477
|
-
# - 'lib/arxutils_sqlite3/dbutil/dbconnect.rb'
|
|
478
|
-
|
|
479
|
-
# Offense count: 5
|
|
150
|
+
# Offense count: 4
|
|
480
151
|
# This cop supports safe autocorrection (--autocorrect).
|
|
481
152
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
|
482
153
|
# SupportedStyles: single_quotes, double_quotes
|
|
483
154
|
Style/StringLiterals:
|
|
484
155
|
Exclude:
|
|
485
|
-
# - '
|
|
156
|
+
# - 'config/dbsetup.rb'
|
|
486
157
|
# - 'lib/dbacrecord.rb'
|
|
487
|
-
# - 'spec/arxutils__sqlite3_spec.rb'
|
data/Gemfile
CHANGED
|
@@ -12,7 +12,7 @@ gem "simpleoptparse"
|
|
|
12
12
|
# gem "ykutils" , :github => "ykominami/ykutils"
|
|
13
13
|
gem "ykutils", "> 0.1.3"
|
|
14
14
|
gem "ykxutils", "> 0.1.0"
|
|
15
|
-
# gem "ykxutils", :
|
|
15
|
+
# gem "ykxutils", path: "../ykxutils"
|
|
16
16
|
|
|
17
17
|
gem "activesupport"
|
|
18
18
|
# spec.add_runtime_dependency "erb"
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
arxutils_sqlite3 (0.1.
|
|
4
|
+
arxutils_sqlite3 (0.1.54)
|
|
5
5
|
activerecord (~> 6.1)
|
|
6
6
|
activesupport
|
|
7
7
|
simpleoptparse
|
|
@@ -70,7 +70,7 @@ GEM
|
|
|
70
70
|
parser (>= 3.1.1.0)
|
|
71
71
|
rubocop-rake (0.6.0)
|
|
72
72
|
rubocop (~> 1.0)
|
|
73
|
-
rubocop-rspec (2.13.
|
|
73
|
+
rubocop-rspec (2.13.2)
|
|
74
74
|
rubocop (~> 1.33)
|
|
75
75
|
ruby-progressbar (1.11.0)
|
|
76
76
|
simpleoptparse (0.1.2)
|
|
@@ -86,7 +86,7 @@ GEM
|
|
|
86
86
|
erubi
|
|
87
87
|
filex
|
|
88
88
|
tilt
|
|
89
|
-
ykxutils (0.1.
|
|
89
|
+
ykxutils (0.1.7)
|
|
90
90
|
zeitwerk (2.6.0)
|
|
91
91
|
|
|
92
92
|
PLATFORMS
|
data/config/setting.yml
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
---
|
|
2
|
-
:klass:
|
|
2
|
+
:klass: Xenop
|
data/exe/arxutils_sqlite3
CHANGED
|
@@ -8,38 +8,18 @@ require "ykxutils"
|
|
|
8
8
|
|
|
9
9
|
config = Arxutils_Sqlite3::Config.new
|
|
10
10
|
|
|
11
|
-
config.
|
|
11
|
+
opts, klass = config.setupx(self)
|
|
12
|
+
# p opts
|
|
13
|
+
# p klass
|
|
14
|
+
# exit
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
acrecord = opts[:acrecord]
|
|
16
|
-
if acrecord
|
|
17
|
-
filename = acrecord[:filename]
|
|
18
|
-
basename = File.basename(filename)
|
|
19
|
-
|
|
20
|
-
begin
|
|
21
|
-
require basename.to_s
|
|
22
|
-
rescue LoadError
|
|
23
|
-
# pp ex.message
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
opts[:db_dir] = Arxutils_Sqlite3::Config::DB_DIR
|
|
28
|
-
|
|
29
|
-
setting = config.load_setting_yaml_file
|
|
30
|
-
klass = setting[:klass]
|
|
31
|
-
|
|
32
|
-
# DBセットアップクラス
|
|
33
|
-
config.require_dbsetup_file
|
|
34
|
-
|
|
35
|
-
banner = "Usage: bundle exec arxutils_sqlite3 --cmd=(s|cds|co|c|f|m|a|d|b) -y yaml_file --klass=class"
|
|
16
|
+
banner = "Usage: bundle exec arxutils_sqlite3 --cmd=(s|cds|co|c|f|m|a|d|b|y) -y yaml_file --klass=class"
|
|
36
17
|
|
|
37
18
|
Simpleoptparse::Simpleoptparse.parse(ARGV, opts, banner, Arxutils_Sqlite3::VERSION, nil) do |parser|
|
|
38
|
-
parser.on("--cmd X", %w[s cds co c f m a d b]) { |x| opts["cmd"] = x }
|
|
19
|
+
parser.on("--cmd X", %w[s cds co c f m a d b y]) { |x| opts["cmd"] = x }
|
|
39
20
|
parser.on("-y yaml_file", "--yaml yaml_file") { |x| opts["yaml"] = x }
|
|
40
21
|
parser.on("--klass klass") { |x| opts["klass"] = x }
|
|
41
22
|
end
|
|
42
|
-
klass = opts["klass"] if opts["klass"]
|
|
43
23
|
|
|
44
24
|
dbconfig = Arxutils_Sqlite3::Config::DBCONFIG_SQLITE3
|
|
45
25
|
env = ENV.fetch("ENV", nil)
|
|
@@ -93,6 +73,9 @@ when "b"
|
|
|
93
73
|
db_scheme_ary = nil
|
|
94
74
|
acrecord = opts["acrecord"]
|
|
95
75
|
cli.delete_db(db_scheme_ary, acrecord)
|
|
76
|
+
|
|
77
|
+
when "y"
|
|
78
|
+
cli.delete_setting_yaml
|
|
96
79
|
else
|
|
97
80
|
puts "Invalid command(#{opts["cmd"]}) specified!!"
|
|
98
81
|
end
|
data/lib/arxutils_sqlite3/cli.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Arxutils_Sqlite3
|
|
|
11
11
|
# p "make_config_directory"
|
|
12
12
|
@config.make_config_directory
|
|
13
13
|
# p "setup_db_scheme_file"
|
|
14
|
-
@config.setup_db_scheme_file
|
|
14
|
+
@config.setup_db_scheme_file(klass)
|
|
15
15
|
# p "setup_opts_file(#{klass})"
|
|
16
16
|
@config.setup_opts_file(klass)
|
|
17
17
|
# p "setup_setting_yaml_file(#{klass})"
|
|
@@ -41,7 +41,7 @@ module Arxutils_Sqlite3
|
|
|
41
41
|
db_scheme_ary = YAML.load_file(yaml_pn)
|
|
42
42
|
dbconfig_path = @config.make_dbconfig_path(@dbconfig)
|
|
43
43
|
|
|
44
|
-
dest_dbsetup_file = @config.
|
|
44
|
+
dest_dbsetup_file = @config.dest_dbsetup_file
|
|
45
45
|
@config.make_dbsetup_file(db_scheme_ary, acrecord, klass, dest_dbsetup_file)
|
|
46
46
|
|
|
47
47
|
# マイグレーション用スクリプトの生成、acrecordのクラス定義ファイルの生成
|
|
@@ -49,10 +49,12 @@ module Arxutils_Sqlite3
|
|
|
49
49
|
mig.output
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
# マイグレーション実行
|
|
52
53
|
def migrate
|
|
53
54
|
# migrate用スクリプトの出力先ディレクトリ名
|
|
54
|
-
migrate_dir = @config.
|
|
55
|
+
migrate_dir = @config.migrate_dir
|
|
55
56
|
|
|
57
|
+
# DB接続
|
|
56
58
|
Arxutils_Sqlite3::Dbutil::Dbconnect.db_connect(@config, @dbconfig, @env)
|
|
57
59
|
|
|
58
60
|
# マイグレーション実行
|
|
@@ -60,25 +62,38 @@ module Arxutils_Sqlite3
|
|
|
60
62
|
end
|
|
61
63
|
|
|
62
64
|
def acr
|
|
65
|
+
# DB接続
|
|
63
66
|
connect_time = Arxutils_Sqlite3::Dbutil::Dbconnect.db_connect(@config, @dbconfig, @env)
|
|
64
|
-
|
|
67
|
+
# `s` is a variable that is being used to store the value of the `gets` method.
|
|
68
|
+
ret = :SUCCESS
|
|
69
|
+
begin
|
|
70
|
+
Dbsetup.new(connect_time)
|
|
71
|
+
rescue StandardError
|
|
72
|
+
ret = :StandardError
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
ret
|
|
65
76
|
end
|
|
66
77
|
|
|
67
78
|
def delete(db_scheme_ary, acrecord)
|
|
68
|
-
config_dir = @config.
|
|
79
|
+
config_dir = @config.config_dir
|
|
69
80
|
dbconfig_path = Arxutils_Sqlite3::Util.make_dbconfig_path(config_dir, @dbconfig)
|
|
70
81
|
mig = @config.prepare_for_migrate(db_scheme_ary, dbconfig_path, @dbconfig, acrecord)
|
|
71
82
|
mig.delete_migrate_and_config_and_db
|
|
72
83
|
end
|
|
73
84
|
|
|
74
85
|
def delete_db(db_scheme_ary, acrecord)
|
|
75
|
-
config_dir = @config.
|
|
86
|
+
config_dir = @config.config_dir
|
|
76
87
|
dbconfig_path = Arxutils_Sqlite3::Util.make_dbconfig_path(config_dir, @dbconfig)
|
|
77
88
|
mig = @config.prepare_for_migrate(db_scheme_ary, dbconfig_path, @dbconfig, acrecord)
|
|
78
89
|
# mig.delete_migrate_config_and_db
|
|
79
90
|
mig.delete_db
|
|
80
91
|
end
|
|
81
92
|
|
|
93
|
+
def delete_setting_yaml
|
|
94
|
+
FileUtils.rm_f(@config.setting_yaml_file)
|
|
95
|
+
end
|
|
96
|
+
|
|
82
97
|
def rm_dbconfig
|
|
83
98
|
dbconfig_path = @config.make_dbconfig_path(@dbconfig)
|
|
84
99
|
# p dbconfig_path
|
|
@@ -58,7 +58,51 @@ module Arxutils_Sqlite3
|
|
|
58
58
|
# migrateディレクトリへのパス
|
|
59
59
|
MIGRATE_DIR = DB_PN.join(MIGRATE_BASE_DIR)
|
|
60
60
|
|
|
61
|
+
# 削除しないファイル群
|
|
61
62
|
EXCLUDE_FILES = %w[SETTING_YAML_FILE_NAME].freeze
|
|
63
|
+
# 作成対象のActiveRecordの子クラスのデフォルトクラス名
|
|
64
|
+
DEFAULT_KLASS = "Xenop".freeze
|
|
65
|
+
|
|
66
|
+
def default_klass
|
|
67
|
+
DEFAULT_KLASS
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def setting_yaml_file
|
|
71
|
+
SETTING_YAML_FILE
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def dest_dbsetup_file_b
|
|
75
|
+
DEST_DBSETUP_FILE_B
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def setupx(toplevel)
|
|
79
|
+
require_opts_file
|
|
80
|
+
|
|
81
|
+
opts = toplevel.instance_variable_get(:@opts) || {}
|
|
82
|
+
|
|
83
|
+
acrecord = opts[:acrecord]
|
|
84
|
+
if acrecord
|
|
85
|
+
filename = acrecord[:filename]
|
|
86
|
+
basename = File.basename(filename)
|
|
87
|
+
|
|
88
|
+
begin
|
|
89
|
+
require basename.to_s
|
|
90
|
+
rescue LoadError
|
|
91
|
+
# pp ex.message
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
opts[:db_dir] = Arxutils_Sqlite3::Config::DB_DIR
|
|
95
|
+
|
|
96
|
+
setting = load_setting_yaml_file
|
|
97
|
+
# p "setting=#{setting}"
|
|
98
|
+
klass = setting[:klass]
|
|
99
|
+
klass ||= DEFAULT_KLASS
|
|
100
|
+
|
|
101
|
+
# DBセットアップクラス
|
|
102
|
+
require_dbsetup_file
|
|
103
|
+
|
|
104
|
+
[opts, klass]
|
|
105
|
+
end
|
|
62
106
|
|
|
63
107
|
# DB構成ファイル格納ディレクトリの作成
|
|
64
108
|
def make_config_directory
|
|
@@ -66,12 +110,16 @@ module Arxutils_Sqlite3
|
|
|
66
110
|
FileUtils.mkdir_p(CONFIG_DIR)
|
|
67
111
|
end
|
|
68
112
|
|
|
69
|
-
# DB
|
|
70
|
-
def setup_db_scheme_file
|
|
113
|
+
# DBスキームファイルのサンプルファイコピー
|
|
114
|
+
def setup_db_scheme_file(klass)
|
|
71
115
|
# p "config setup_db_scheme_file"
|
|
72
116
|
# p "DB_SCHEME_FILE=#{DB_SCHEME_FILE}"
|
|
73
117
|
# p "SAMPLE_DB_SCHEME_FILE=#{SAMPLE_DB_SCHEME_FILE}"
|
|
74
|
-
|
|
118
|
+
scope = {}
|
|
119
|
+
value_hash = { klass: klass }
|
|
120
|
+
content = Ykutils::Erubyx.erubi_render_with_template_file(DB_SCHEME_FILE, scope, value_hash)
|
|
121
|
+
Ykxutils.yaml_load_compati(content)
|
|
122
|
+
File.write(SAMPLE_DB_SCHEME_FILE, content)
|
|
75
123
|
end
|
|
76
124
|
|
|
77
125
|
# DBスキームファイルが存在しなければ、サンプルファイルをDBスキームファイルとしてコピー
|
|
@@ -102,7 +150,13 @@ module Arxutils_Sqlite3
|
|
|
102
150
|
def setup_setting_yaml_file(klass)
|
|
103
151
|
hash = { klass: klass }
|
|
104
152
|
content = YAML.dump(hash)
|
|
105
|
-
|
|
153
|
+
ret = :SUCCESS
|
|
154
|
+
begin
|
|
155
|
+
File.write(SETTING_YAML_FILE, content)
|
|
156
|
+
rescue StandardError
|
|
157
|
+
ret = :StandardError
|
|
158
|
+
end
|
|
159
|
+
ret
|
|
106
160
|
end
|
|
107
161
|
|
|
108
162
|
# DB構成ファイルの作成
|
|
@@ -134,7 +188,7 @@ module Arxutils_Sqlite3
|
|
|
134
188
|
|
|
135
189
|
# Dbsetupファイル(Rubyスクリプトファイル)のrequire
|
|
136
190
|
def require_dbsetup_file
|
|
137
|
-
dbsetup_file = File.join(".",
|
|
191
|
+
dbsetup_file = File.join(".", dest_dbsetup_file_b.to_s)
|
|
138
192
|
begin
|
|
139
193
|
require dbsetup_file
|
|
140
194
|
rescue LoadError
|
|
@@ -160,66 +214,49 @@ module Arxutils_Sqlite3
|
|
|
160
214
|
exit exit_code
|
|
161
215
|
end
|
|
162
216
|
|
|
163
|
-
# 変換先optsファイル(Rubyスクリプトファイル)へのパス
|
|
164
|
-
def get_dest_opts_file
|
|
165
|
-
DEST_OPTS_FILE
|
|
166
|
-
end
|
|
167
|
-
|
|
168
217
|
# DB格納ディレクトリ名
|
|
169
|
-
def
|
|
218
|
+
def db_dir
|
|
170
219
|
DB_DIR
|
|
171
220
|
end
|
|
172
221
|
|
|
173
222
|
# migrateディレクトリへのパス
|
|
174
|
-
def
|
|
223
|
+
def migrate_dir
|
|
175
224
|
MIGRATE_DIR
|
|
176
225
|
end
|
|
177
226
|
|
|
178
227
|
# コンフィグディレクトリへのパス
|
|
179
|
-
def
|
|
228
|
+
def config_dir
|
|
180
229
|
CONFIG_DIR
|
|
181
230
|
end
|
|
182
231
|
|
|
183
232
|
# リレーションテンプレートディレクトリへのパス
|
|
184
|
-
def
|
|
233
|
+
def template_acrecord_dir
|
|
185
234
|
TEMPLATE_ACRECORD_DIR
|
|
186
235
|
end
|
|
187
236
|
|
|
188
237
|
# テンプレートディレクトリへのパス
|
|
189
|
-
def
|
|
238
|
+
def template_config_dir
|
|
190
239
|
TEMPLATE_CONFIG_DIR
|
|
191
240
|
end
|
|
192
241
|
|
|
193
242
|
# 変換先Dbsetupクラス定義のRubyスクリプトファイルへのパス
|
|
194
|
-
def
|
|
243
|
+
def src_dbsetup_file
|
|
195
244
|
DBSETUP_FILE
|
|
196
245
|
end
|
|
197
246
|
|
|
198
247
|
# 変換先Dbsetupクラス定義のRubyスクリプトファイルへのパス
|
|
199
|
-
def
|
|
248
|
+
def dest_dbsetup_file
|
|
200
249
|
DEST_DBSETUP_FILE
|
|
201
250
|
end
|
|
202
251
|
|
|
203
|
-
# 変換先Dbsetupクラス定義のRubyスクリプトファイル(拡張子無し)へのパス
|
|
204
|
-
def get_dest_dbsetup_file_b
|
|
205
|
-
DEST_DBSETUP_FILE_B
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
# 変換後DBスキームファイル名(拡張子無し)
|
|
209
|
-
def get_dest_db_scheme_file
|
|
210
|
-
DEST_DB_SCHEME_FILE_B
|
|
211
|
-
end
|
|
212
|
-
|
|
213
252
|
# DBログファイルの作成
|
|
214
253
|
def setup_for_db_log_path(dbconfig)
|
|
215
|
-
db_dir = get_db_dir
|
|
216
254
|
# DBログファイルへのパス
|
|
217
255
|
Arxutils_Sqlite3::Util.make_log_path(db_dir, dbconfig)
|
|
218
256
|
end
|
|
219
257
|
|
|
220
258
|
# DB構成ファイルの作成
|
|
221
259
|
def setup_for_dbconfig_path(dbconfig)
|
|
222
|
-
config_dir = get_config_dir
|
|
223
260
|
# DB構成ファイル名
|
|
224
261
|
Arxutils_Sqlite3::Util.make_dbconfig_path(config_dir, dbconfig)
|
|
225
262
|
end
|
|
@@ -236,7 +273,7 @@ module Arxutils_Sqlite3
|
|
|
236
273
|
# DB構成ファイルの出力先ディレクトリ
|
|
237
274
|
dbconfig_src_fname = "#{dbconfig}.tmpl"
|
|
238
275
|
# migrate用スクリプトの出力先ディレクトリ名
|
|
239
|
-
migrate_dir = get_migrate_dir
|
|
276
|
+
# migrate_dir = get_migrate_dir
|
|
240
277
|
|
|
241
278
|
Migrate.new(
|
|
242
279
|
self,
|
|
@@ -249,8 +286,6 @@ module Arxutils_Sqlite3
|
|
|
249
286
|
end
|
|
250
287
|
|
|
251
288
|
def make_dbsetup_file(db_scheme_ary, acrecord, klass, dest_dbsetup_file)
|
|
252
|
-
src_dbsetup_file = get_src_dbsetup_file
|
|
253
|
-
|
|
254
289
|
scope = Object.new
|
|
255
290
|
hash0 = { module_name: acrecord[:module].join("::") }
|
|
256
291
|
hash = db_scheme_ary[0].merge(hash0)
|
|
@@ -49,8 +49,8 @@ module Arxutils_Sqlite3
|
|
|
49
49
|
ActiveRecord::Base.establish_connection(dbconfig[@env])
|
|
50
50
|
ActiveRecord::Base.logger = Logger.new(@log_path)
|
|
51
51
|
@connect_time = DateTime.now.new_offset
|
|
52
|
-
rescue StandardError =>
|
|
53
|
-
p
|
|
52
|
+
rescue StandardError => e
|
|
53
|
+
p e.message
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
@connect_time
|
|
@@ -30,18 +30,18 @@ module Arxutils_Sqlite3
|
|
|
30
30
|
# アプリ構成情報
|
|
31
31
|
@config = config
|
|
32
32
|
# DB格納ディレクトリ名
|
|
33
|
-
@db_dir = config.
|
|
33
|
+
@db_dir = config.db_dir
|
|
34
34
|
# DB構成ファイルの出力先ディレクトリ
|
|
35
|
-
@dest_config_dir = config.
|
|
35
|
+
@dest_config_dir = config.config_dir
|
|
36
36
|
# 生成するDB構成情報ファイルパス
|
|
37
37
|
@dbconfig_dest_path = dbconfig_dest_path
|
|
38
38
|
# 参照用DB構成情報ファイル名
|
|
39
39
|
@dbconfig_src_fname = dbconfig_src_fname
|
|
40
40
|
|
|
41
41
|
# テンプレートファイル格納ディレクトリ名
|
|
42
|
-
@src_path = config.
|
|
42
|
+
@src_path = config.template_acrecord_dir
|
|
43
43
|
# 構成ファイル格納ディレクトリ
|
|
44
|
-
@src_config_path = config.
|
|
44
|
+
@src_config_path = config.template_config_dir
|
|
45
45
|
# @src_config_path = Arxutils_Sqlite3::TEMPLATE_CONFIG_DIR
|
|
46
46
|
# データベーススキーマ定義配列
|
|
47
47
|
@db_scheme_ary = db_scheme_ary
|
|
@@ -215,14 +215,21 @@ module Arxutils_Sqlite3
|
|
|
215
215
|
dir = acrecord_config[:dir]
|
|
216
216
|
fname = acrecord_config[:filename]
|
|
217
217
|
fpath = File.join(dir, fname)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
file.puts
|
|
222
|
-
|
|
218
|
+
ret = :SUCCESS
|
|
219
|
+
begin
|
|
220
|
+
File.open(fpath, "w") do |file|
|
|
221
|
+
acrecord_config[:module].map { |mod| file.puts("module #{mod}") }
|
|
222
|
+
content_array.map do |x|
|
|
223
|
+
file.puts x
|
|
224
|
+
file.puts ""
|
|
225
|
+
end
|
|
226
|
+
acrecord_config[:module].map { |_mod| file.puts("end") }
|
|
223
227
|
end
|
|
224
|
-
|
|
228
|
+
rescue StandardError
|
|
229
|
+
ret = :StandardError
|
|
225
230
|
end
|
|
231
|
+
|
|
232
|
+
ret
|
|
226
233
|
end
|
|
227
234
|
end
|
|
228
235
|
end
|
|
@@ -5,64 +5,78 @@ config = Arxutils_Sqlite3::Config.new
|
|
|
5
5
|
klass = nil
|
|
6
6
|
setting = config.load_setting_yaml_file
|
|
7
7
|
klass = setting[:klass]
|
|
8
|
+
klass = config.default_klass if klass.nil?
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
desc_arxutils_sqlite3 = "setup copy_db_scheme copy_opts makeconfig make_migrate_script migrate acr"
|
|
11
|
+
|
|
12
|
+
desc desc_arxutils_sqlite3.to_s
|
|
13
|
+
task arxutils_sqlite3: %w[arx:setup arx:copy_db_scheme arx:copy_opts arx:makeconfig arx:make_migrate_script arx:migrate arx:acr]
|
|
14
|
+
|
|
15
|
+
desc desc_arxutils_sqlite3.to_s
|
|
16
|
+
task "arx:arxutils_sqlite3": %w[arxutils_sqlite3]
|
|
11
17
|
|
|
12
18
|
desc "delete setup copy_db_scheme copy_opts makeconfig make_migrate_script migrate acr"
|
|
13
|
-
task bootstrap: %w[delete arxutils_sqlite3]
|
|
19
|
+
task "arx:bootstrap": %w[arx:delete arxutils_sqlite3]
|
|
14
20
|
|
|
15
21
|
desc "migrate acr"
|
|
16
|
-
task ma: %w[migrate acr]
|
|
22
|
+
task "arx:ma": %w[arx:migrate arx:acr]
|
|
17
23
|
|
|
18
24
|
desc "delete_db"
|
|
19
|
-
task b: %w[delete_db]
|
|
25
|
+
task "arx:b": %w[arx:delete_db]
|
|
26
|
+
|
|
27
|
+
desc "delete setting.yaml"
|
|
28
|
+
task "arx:ds": %w[arx:delete_setting]
|
|
20
29
|
|
|
21
30
|
# コマンドラインで指定したクラス名を含むオプション指定用ハッシュの定義を含むRubyスクリ
|
|
22
31
|
# プトファイルの生成
|
|
23
32
|
desc "produce setting.yml, db_scheme.yml.sample and opts.rb.sample with class name #{klass}"
|
|
24
|
-
task :setup do
|
|
33
|
+
task "arx:setup" do
|
|
25
34
|
sh "bundle exec arxutils_sqlite3 --cmd=s --klass=#{klass}"
|
|
26
35
|
end
|
|
27
36
|
|
|
28
37
|
desc "copy from db_scheme.yml.sample to db_scheme.yml"
|
|
29
|
-
task :copy_db_scheme do
|
|
38
|
+
task "arx:copy_db_scheme" do
|
|
30
39
|
sh "bundle exec arxutils_sqlite3 --cmd=cds"
|
|
31
40
|
end
|
|
32
41
|
|
|
33
42
|
desc "copy from opts.rb.sample to opts.rb"
|
|
34
|
-
task :copy_opts do
|
|
43
|
+
task "arx:copy_opts" do
|
|
35
44
|
sh "bundle exec arxutils_sqlite3 --cmd=co"
|
|
36
45
|
end
|
|
37
46
|
|
|
38
47
|
# DB構成情報の生成
|
|
39
48
|
desc "produce sqlite3.yml"
|
|
40
|
-
task :makeconfig do
|
|
49
|
+
task "arx:makeconfig" do
|
|
41
50
|
sh "bundle exec arxutils_sqlite3 --cmd=c"
|
|
42
51
|
end
|
|
43
52
|
|
|
44
53
|
# マイグレート用スクリプトファイルの生成
|
|
45
54
|
desc "produce migration scripts"
|
|
46
|
-
task :make_migrate_script do
|
|
55
|
+
task "arx:make_migrate_script" do
|
|
47
56
|
sh "bundle exec arxutils_sqlite3 --cmd=f --yaml=config/db_scheme.yml"
|
|
48
57
|
end
|
|
49
58
|
# マイグレートの実行
|
|
50
59
|
desc "execute migration"
|
|
51
|
-
task :migrate do
|
|
60
|
+
task "arx:migrate" do
|
|
52
61
|
sh "bundle exec arxutils_sqlite3 --cmd=m"
|
|
53
62
|
end
|
|
54
63
|
|
|
55
64
|
desc "call ActiveRecord instance method"
|
|
56
|
-
task :acr do
|
|
65
|
+
task "arx:acr" do
|
|
57
66
|
sh "bundle exec arxutils_sqlite3 --cmd=a"
|
|
58
67
|
end
|
|
59
68
|
|
|
60
69
|
desc "delete configuration files adn migration scripts and db files"
|
|
61
|
-
task :delete do
|
|
70
|
+
task "arx:delete" do
|
|
62
71
|
sh "bundle exec arxutils_sqlite3 --cmd=d"
|
|
63
72
|
end
|
|
64
73
|
|
|
65
74
|
desc "delete db files"
|
|
66
|
-
task :delete_db do
|
|
75
|
+
task "arx:delete_db" do
|
|
67
76
|
sh "bundle exec arxutils_sqlite3 --cmd=b"
|
|
68
77
|
end
|
|
78
|
+
|
|
79
|
+
desc "delete setting yaml"
|
|
80
|
+
task "arx:delete_setting" do
|
|
81
|
+
sh "bundle exec arxutils_sqlite3 --cmd=y"
|
|
82
|
+
end
|
data/lib/dbacrecord.rb
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
module
|
|
1
|
+
module Xenop
|
|
2
2
|
module Dbutil
|
|
3
3
|
class Count < ActiveRecord::Base
|
|
4
|
-
has_many :
|
|
4
|
+
has_many :invalidxenoplists
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
class Countdatetime < ActiveRecord::Base
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class Xenop < ActiveRecord::Base
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
class
|
|
13
|
+
class Xenoplist < ActiveRecord::Base
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
class
|
|
17
|
-
belongs_to :
|
|
18
|
-
belongs_to :count
|
|
16
|
+
class Invalidxenoplist < ActiveRecord::Base
|
|
17
|
+
belongs_to :xenoplist, foreign_key: 'org_id'
|
|
18
|
+
belongs_to :count, foreign_key: ''
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
class
|
|
22
|
-
belongs_to :
|
|
21
|
+
class Currentxenoplist < ActiveRecord::Base
|
|
22
|
+
belongs_to :xenoplist , foreign_key: 'org_id'
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
class Invalid<%= @data[:classname_downcase] %> < ActiveRecord::Base
|
|
2
|
-
belongs_to :<%= @data[:classname_downcase]
|
|
3
|
-
belongs_to :<%= @data[:count_classname_downcase]
|
|
2
|
+
belongs_to :<%= @data[:classname_downcase] %>, foreign_key: 'org_id'
|
|
3
|
+
belongs_to :<%= @data[:count_classname_downcase] %>, foreign_key: '<%= @data[:count_field] %>'
|
|
4
4
|
end
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
:ar_version: 6.0
|
|
12
12
|
- :flist:
|
|
13
13
|
- noitem
|
|
14
|
-
:classname:
|
|
15
|
-
:classname_downcase:
|
|
14
|
+
:classname: <%= klass %>
|
|
15
|
+
:classname_downcase: <%= klass.downcase %>
|
|
16
16
|
:items:
|
|
17
17
|
- - time_id
|
|
18
18
|
- integer
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
- - ennb_id
|
|
21
21
|
- integer
|
|
22
22
|
- 'false'
|
|
23
|
-
:plural:
|
|
23
|
+
:plural: <%= klass.downcase %>s
|
|
24
24
|
:ar_version: 6.0
|
|
25
25
|
- :flist:
|
|
26
26
|
- noitem
|
|
27
27
|
- invalid
|
|
28
28
|
- current
|
|
29
|
-
:classname:
|
|
30
|
-
:classname_downcase:
|
|
29
|
+
:classname: <%= klass %>list
|
|
30
|
+
:classname_downcase: <%= klass.downcase %>list
|
|
31
31
|
:items:
|
|
32
32
|
- - stack
|
|
33
33
|
- string
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
- - start_datetime
|
|
45
45
|
- datetime
|
|
46
46
|
- 'false'
|
|
47
|
-
:plural:
|
|
47
|
+
:plural: <%= klass.downcase %>lists
|
|
48
48
|
:ar_version: 6.0
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
require_relative '../lib/dbacrecord'
|
|
2
|
+
|
|
1
3
|
class Dbsetup
|
|
2
4
|
def initialize(connect_time)
|
|
3
5
|
@connect_time = connect_time
|
|
4
6
|
@ct = <%= klass %>::Dbutil::Countdatetime.create( countdatetime: @connect_time )
|
|
5
|
-
@hs_by_notebook =
|
|
6
|
-
@hs_by_id =
|
|
7
|
+
@hs_by_notebook = {}
|
|
8
|
+
@hs_by_id = {}
|
|
7
9
|
end
|
|
8
10
|
=begin
|
|
9
11
|
# 指定stack(文字列)にノートブック(文字列)、ノートブック数、タグ数を追加
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: arxutils_sqlite3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.54
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yasuo kominami
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-09-
|
|
11
|
+
date: 2022-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -236,7 +236,6 @@ files:
|
|
|
236
236
|
- lib/template/acrecord/base.tmpl
|
|
237
237
|
- lib/template/acrecord/current.tmpl
|
|
238
238
|
- lib/template/acrecord/db_scheme/db_scheme.yml
|
|
239
|
-
- lib/template/acrecord/db_scheme/db_scheme.yml.sample
|
|
240
239
|
- lib/template/acrecord/db_scheme/dbsetup.tmpl
|
|
241
240
|
- lib/template/acrecord/db_scheme/opts.rb.sample
|
|
242
241
|
- lib/template/acrecord/db_scheme/opts.tmpl
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
- :flist:
|
|
3
|
-
- noitem
|
|
4
|
-
:classname: Countdatetime
|
|
5
|
-
:classname_downcase: countdatetime
|
|
6
|
-
:items:
|
|
7
|
-
- - countdatetime
|
|
8
|
-
- datetime
|
|
9
|
-
- 'false'
|
|
10
|
-
:plural: countdatetimes
|
|
11
|
-
:ar_version: 6.0
|
|
12
|
-
- :flist:
|
|
13
|
-
- noitem
|
|
14
|
-
:classname: Evnb
|
|
15
|
-
:classname_downcase: evnb
|
|
16
|
-
:items:
|
|
17
|
-
- - time_id
|
|
18
|
-
- integer
|
|
19
|
-
- 'false'
|
|
20
|
-
- - ennb_id
|
|
21
|
-
- integer
|
|
22
|
-
- 'false'
|
|
23
|
-
:plural: evnbs
|
|
24
|
-
:ar_version: 6.0
|
|
25
|
-
- :flist:
|
|
26
|
-
- noitem
|
|
27
|
-
- invalid
|
|
28
|
-
- current
|
|
29
|
-
:classname: Ennblist
|
|
30
|
-
:classname_downcase: ennblist
|
|
31
|
-
:items:
|
|
32
|
-
- - stack
|
|
33
|
-
- string
|
|
34
|
-
- 'false'
|
|
35
|
-
- - notebook
|
|
36
|
-
- string
|
|
37
|
-
- 'false'
|
|
38
|
-
- - count
|
|
39
|
-
- integer
|
|
40
|
-
- 'false'
|
|
41
|
-
- - tag_count
|
|
42
|
-
- integer
|
|
43
|
-
- 'false'
|
|
44
|
-
- - start_datetime
|
|
45
|
-
- datetime
|
|
46
|
-
- 'false'
|
|
47
|
-
:plural: ennblists
|
|
48
|
-
:ar_version: 6.0
|