master_data_tool 0.21.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/master_data_tool +3 -65
- data/lib/master_data_tool/act_as_master_data.rb +13 -0
- data/lib/master_data_tool/command/dump.rb +43 -0
- data/lib/master_data_tool/command/import.rb +86 -0
- data/lib/master_data_tool/command/verify.rb +64 -0
- data/lib/master_data_tool/command.rb +5 -0
- data/lib/master_data_tool/config.rb +2 -2
- data/lib/master_data_tool/dump/config.rb +42 -0
- data/lib/master_data_tool/dump/executor.rb +9 -15
- data/lib/master_data_tool/dump.rb +1 -0
- data/lib/master_data_tool/import/config.rb +35 -0
- data/lib/master_data_tool/import/executor.rb +49 -76
- data/lib/master_data_tool/import.rb +1 -0
- data/lib/master_data_tool/master_data.rb +48 -36
- data/lib/master_data_tool/master_data_collection.rb +1 -1
- data/lib/master_data_tool/master_data_file.rb +4 -4
- data/lib/master_data_tool/master_data_file_collection.rb +10 -8
- data/lib/master_data_tool/master_data_status.rb +18 -9
- data/lib/master_data_tool/report/core.rb +2 -2
- data/lib/master_data_tool/report/default_printer.rb +1 -1
- data/lib/master_data_tool/report/import_report.rb +13 -15
- data/lib/master_data_tool/report/print_affected_table_report.rb +2 -2
- data/lib/master_data_tool/report/printer.rb +2 -2
- data/lib/master_data_tool/report/verify_report.rb +8 -8
- data/lib/master_data_tool/spec_config.rb +8 -10
- data/lib/master_data_tool/verify/config.rb +39 -0
- data/lib/master_data_tool/verify/executor.rb +39 -0
- data/lib/master_data_tool/verify.rb +4 -0
- data/lib/master_data_tool/version.rb +1 -1
- data/lib/master_data_tool.rb +21 -3
- data/sig/master_data_tool.rbs +323 -171
- metadata +38 -15
- data/LICENSE +0 -21
- data/README.md +0 -242
data/sig/master_data_tool.rbs
CHANGED
@@ -1,25 +1,198 @@
|
|
1
|
-
# TypeProf 0.21.3
|
2
|
-
|
3
|
-
# Classes
|
4
1
|
module MasterDataTool
|
5
2
|
VERSION: String
|
6
|
-
self.@config: Config
|
7
3
|
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
module ActAsMasterData
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
def master_data?: () -> true
|
8
|
+
end
|
11
9
|
|
12
10
|
class Config
|
13
|
-
|
11
|
+
include ActiveSupport::Configurable
|
12
|
+
|
13
|
+
def initialize: () -> void
|
14
|
+
|
15
|
+
def spec_config: (String spec_name) -> untyped
|
16
|
+
|
17
|
+
def csv_dir_for: (spec_name: String, override_identifier: String?) -> Pathname
|
14
18
|
end
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
module Dump
|
21
|
+
class Config
|
22
|
+
DEFAULT_IGNORE_TABLES: [String]
|
23
|
+
DEFAULT_IGNORE_COLUMNS: [String]
|
24
|
+
DEFAULT_VALUES: { ignore_empty_table: bool, ignore_tables: Array[String], ignore_column_names: Array[String], only_tables: Array[String] }
|
25
|
+
|
26
|
+
attr_accessor ignore_empty_table: bool
|
27
|
+
attr_accessor ignore_tables: Array[String]
|
28
|
+
attr_accessor ignore_column_names: Array[String]
|
29
|
+
attr_accessor only_tables: Array[String]
|
30
|
+
|
31
|
+
def initialize: (ignore_empty_table: bool, ignore_tables: Array[String], ignore_column_names: Array[String], only_tables: Array[String]) -> void
|
32
|
+
|
33
|
+
def configure: () -> Config
|
34
|
+
|
35
|
+
def self.default_config: () -> Config
|
36
|
+
end
|
37
|
+
|
38
|
+
class Executor
|
39
|
+
class Error < Struct[untyped]
|
40
|
+
attr_accessor table: String
|
41
|
+
attr_accessor exception: StandardError
|
42
|
+
end
|
43
|
+
|
44
|
+
def initialize: (spec_config: SpecConfig, dump_config: Dump::Config, verbose: bool) -> void
|
45
|
+
|
46
|
+
def execute: () -> Array[Error]
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
attr_reader spec_config: SpecConfig
|
51
|
+
attr_reader dump_config: Dump::Config
|
52
|
+
attr_reader verbose: bool
|
53
|
+
|
54
|
+
def print_message: (String message) -> nil
|
55
|
+
|
56
|
+
def dump_to_csv: (String table) -> nil
|
57
|
+
|
58
|
+
def ignore?: (Class model_klass) -> bool
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
module Import
|
63
|
+
class Config
|
64
|
+
DEFAULT_VALUES: { only_tables: Array[String], except_tables: Array[String], skip_no_change: bool, ignore_foreign_key_when_delete: bool }
|
65
|
+
|
66
|
+
attr_accessor only_tables: Array[String]
|
67
|
+
attr_accessor except_tables: Array[String]
|
68
|
+
attr_accessor skip_no_change: bool
|
69
|
+
attr_accessor ignore_foreign_key_when_delete: bool
|
70
|
+
|
71
|
+
def initialize: (only_tables: Array[String], except_tables: Array[String], skip_no_change: bool, ignore_foreign_key_when_delete: bool) -> void
|
72
|
+
|
73
|
+
def skip_table?: (String table_name) -> bool
|
74
|
+
|
75
|
+
def configure: () -> Config
|
76
|
+
|
77
|
+
def self.default_config: () -> Config
|
78
|
+
end
|
79
|
+
|
80
|
+
class Executor
|
81
|
+
def initialize: (spec_config: SpecConfig, import_config: Import::Config?, verify_config: Verify::Config?, dry_run: bool, verify: bool, silent: bool, override_identifier: String?, report_printer: Report::Printer?) -> void
|
82
|
+
|
83
|
+
def execute: () -> nil
|
84
|
+
|
85
|
+
private
|
86
|
+
|
87
|
+
attr_reader spec_config: SpecConfig
|
88
|
+
attr_reader import_config: Import::Config
|
89
|
+
attr_reader verify_config: Verify::Config
|
90
|
+
attr_reader dry_run: bool
|
91
|
+
attr_reader verify: bool
|
92
|
+
attr_reader silent: bool
|
93
|
+
attr_reader override_identifier: String?
|
94
|
+
attr_reader report_printer: Report::DefaultPrinter
|
95
|
+
attr_reader master_data_statuses_by_name: Hash[String, MasterDataStatus]
|
96
|
+
|
97
|
+
def load_master_data_statuses: () -> Hash[String, MasterDataStatus]
|
98
|
+
|
99
|
+
def print_execute_options: () -> nil
|
100
|
+
|
101
|
+
def build_master_data_collection: () -> MasterDataCollection
|
102
|
+
|
103
|
+
def import_all!: (MasterDataCollection master_data_collection) -> untyped
|
104
|
+
|
105
|
+
def transaction: -> untyped
|
106
|
+
|
107
|
+
def verify_all!: (MasterDataCollection master_data_collection) -> untyped
|
108
|
+
|
109
|
+
def save_master_data_statuses!: (MasterDataCollection master_data_collection) -> untyped
|
110
|
+
|
111
|
+
def print_affected_tables: (MasterDataCollection master_data_collection) -> untyped
|
112
|
+
|
113
|
+
def load_skip_table?: (MasterDataFile master_data_file) -> bool
|
114
|
+
|
115
|
+
def extract_master_data_csv_paths: () -> Array[Pathname]
|
116
|
+
|
117
|
+
def overridden_master_data_csv_paths: () -> Array[Pathname]
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
class MasterData
|
122
|
+
@affected: bool
|
123
|
+
@before_count: Integer
|
124
|
+
@after_count: Integer
|
125
|
+
|
126
|
+
attr_reader master_data_file: MasterDataFile
|
127
|
+
attr_reader model_klass: Class
|
128
|
+
attr_accessor columns: Array[String]
|
129
|
+
attr_reader spec_config: SpecConfig
|
130
|
+
attr_writer loaded: bool
|
131
|
+
attr_writer new_records: Array[ActiveRecord::Base]
|
132
|
+
attr_writer updated_records: Array[ActiveRecord::Base]
|
133
|
+
attr_writer no_change_records: Array[ActiveRecord::Base]
|
134
|
+
attr_writer deleted_records: Array[ActiveRecord::Base]
|
135
|
+
|
136
|
+
def decide_preload_associations: (Verify::Config verify_config) -> Array[String]
|
137
|
+
|
138
|
+
def decide_eager_load_associations: (Verify::Config verify_config) -> Array[String]
|
139
|
+
|
140
|
+
def initialize: (spec_config: SpecConfig, master_data_file: MasterDataFile, model_klass: Class) -> void
|
141
|
+
|
142
|
+
def self.build: (spec_config: SpecConfig, master_data_file: MasterDataFile, load: bool) -> MasterData
|
143
|
+
|
144
|
+
def basename: () -> Pathname
|
145
|
+
|
146
|
+
def load: () -> true
|
147
|
+
|
148
|
+
def import_records: () -> Array[ActiveRecord::Base]
|
149
|
+
|
150
|
+
def affected_records: () -> Array[ActiveRecord::Base]
|
151
|
+
|
152
|
+
def new_records: () -> Array[ActiveRecord::Base]
|
153
|
+
|
154
|
+
def updated_records: () -> Array[ActiveRecord::Base]
|
155
|
+
|
156
|
+
def no_change_records: () -> Array[ActiveRecord::Base]
|
157
|
+
|
158
|
+
def deleted_records: () -> Array[ActiveRecord::Base]
|
159
|
+
|
160
|
+
def loaded?: () -> bool
|
161
|
+
|
162
|
+
def affected?: () -> bool
|
163
|
+
|
164
|
+
def before_count: () -> Integer
|
165
|
+
|
166
|
+
def after_count: () -> Integer
|
167
|
+
|
168
|
+
def table_name: () -> String
|
169
|
+
|
170
|
+
def import!: (import_config: Import::Config, ?dry_run: bool) -> Report::ImportReport
|
171
|
+
|
172
|
+
def verify!: (verify_config: Verify::Config, ?ignore_fail: bool) -> Report::VerifyReport
|
173
|
+
|
174
|
+
def print_affected_table: () -> Report::PrintAffectedTableReport
|
175
|
+
|
176
|
+
private
|
177
|
+
|
178
|
+
def build_records_from_csv: (untyped csv, Hash[Integer, ActiveRecord::Base] old_records_by_id) -> Hash[Integer, ActiveRecord::Base]
|
179
|
+
|
180
|
+
def enable_foreign_key_checks: () -> void
|
181
|
+
|
182
|
+
def disable_foreign_key_checks: () -> void
|
183
|
+
end
|
184
|
+
|
185
|
+
class MasterDataCollection
|
186
|
+
@collection: Array[MasterData]
|
187
|
+
|
188
|
+
def initialize: () -> void
|
189
|
+
|
190
|
+
def append: (master_data: MasterData) -> Array[MasterData]
|
191
|
+
|
192
|
+
def each: () { (MasterData) -> void } -> void
|
193
|
+
| () -> Enumerator[void, MasterData]
|
194
|
+
|
195
|
+
def to_a: () -> Array[MasterData]
|
23
196
|
end
|
24
197
|
|
25
198
|
class MasterDataFile
|
@@ -27,224 +200,203 @@ module MasterDataTool
|
|
27
200
|
attr_reader table_name: String
|
28
201
|
attr_reader path: Pathname
|
29
202
|
attr_reader override_identifier: String?
|
30
|
-
|
31
|
-
def
|
32
|
-
|
33
|
-
def
|
203
|
+
|
204
|
+
def initialize: (spec_name: String, table_name: String, path: Pathname, override_identifier: String?) -> void
|
205
|
+
|
206
|
+
def self.build: (spec_name: String, path: Pathname, override_identifier: String?) -> MasterDataFile
|
207
|
+
|
208
|
+
def basename: () -> Pathname
|
209
|
+
|
210
|
+
def ==: (Integer | Object other) -> bool
|
211
|
+
|
34
212
|
alias eql? ==
|
35
|
-
|
213
|
+
|
214
|
+
def hash: () -> Integer
|
36
215
|
end
|
37
216
|
|
38
217
|
class MasterDataFileCollection
|
39
|
-
|
40
|
-
|
41
|
-
|
218
|
+
attr_reader collection: [MasterDataFile]
|
219
|
+
attr_reader spec_name: String
|
220
|
+
attr_reader override_identifier: String?
|
221
|
+
|
222
|
+
def initialize: (spec_name: String, override_identifier: String?) -> void
|
223
|
+
|
224
|
+
def to_a: () -> Array[MasterDataFile]
|
42
225
|
|
43
|
-
def
|
44
|
-
|
45
|
-
def to_a: -> Array[MasterDataFile]
|
226
|
+
def each: () { (MasterDataFile) -> void } -> void
|
227
|
+
| () -> Enumerator[void, MasterDataFile]
|
46
228
|
|
47
229
|
private
|
48
|
-
def build: -> Array[MasterDataFile]
|
49
|
-
def extract_master_data_csv_paths: -> Array[MasterDataFile]
|
50
|
-
def overridden_master_data_csv_paths: -> Array[MasterDataFile]
|
51
|
-
end
|
52
230
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
attr_reader default_import_options: Hash[String,Class]
|
59
|
-
attr_reader logger: Logger
|
60
|
-
attr_reader preload_associations: Hash[Class, Array[Symbol]]
|
61
|
-
attr_reader eager_load_associations: Hash[Class, Array[Symbol]]
|
62
|
-
|
63
|
-
def initialize: (spec_name: String, application_record_class: Class, dump_ignore_tables: Array[String], dump_ignore_columns: Array[String],
|
64
|
-
default_import_options: Hash[String,Class], logger: Logger, preload_associations: Hash[Class, Array[Symbol]], eager_load_associations: Hash[Class, Array[Symbol]]) -> void
|
231
|
+
def build: () -> untyped
|
232
|
+
|
233
|
+
def extract_master_data_csv_paths: () -> untyped
|
234
|
+
|
235
|
+
def overridden_master_data_csv_paths: () -> Array[untyped]
|
65
236
|
end
|
66
237
|
|
67
|
-
class
|
68
|
-
|
69
|
-
@affected: bool
|
70
|
-
@preload_associations: Array[untyped]
|
71
|
-
@eager_load_associations: Array[untyped]
|
238
|
+
class MasterDataStatus
|
239
|
+
def will_change?: (MasterData master_data_file) -> bool
|
72
240
|
|
73
|
-
|
74
|
-
attr_reader master_data_file: MasterDataFile
|
75
|
-
attr_reader model_klass: untyped
|
76
|
-
attr_reader columns: Array[String]
|
77
|
-
attr_reader new_records: Array[untyped]
|
78
|
-
def new_records: -> Array[untyped]
|
79
|
-
attr_reader updated_records: Array[untyped]
|
80
|
-
def updated_records: -> Array[untyped]
|
81
|
-
attr_reader no_change_records: Array[untyped]
|
82
|
-
def no_change_records: -> Array[untyped]
|
83
|
-
attr_reader deleted_records: Array[untyped]
|
84
|
-
def deleted_records: -> Array[untyped]
|
85
|
-
attr_reader before_count: Integer
|
86
|
-
def before_count: -> Integer
|
87
|
-
attr_reader after_count: Integer
|
88
|
-
def after_count: -> Integer
|
89
|
-
def initialize: (SpecConfig spec_config, MasterDataFile master_data_file, untyped model_klass) -> void
|
90
|
-
def self.build: (SpecConfig spec_config, MasterDataFile master_data_file, ?load: bool) -> MasterData
|
91
|
-
def basename: -> Pathname
|
92
|
-
def load: -> true
|
93
|
-
def import_records: -> Array[untyped]
|
94
|
-
def affected_records: -> Array[untyped]
|
95
|
-
def loaded?: -> bool
|
96
|
-
def affected?: -> bool?
|
97
|
-
def table_name: -> String
|
98
|
-
def import!: (?dry_run: true, ?delete_all_ignore_foreign_key: false) -> Report::ImportReport
|
99
|
-
def verify!: (?ignore_fail: bool) -> Report::VerifyReport
|
100
|
-
def print_affected_table: -> Report::PrintAffectedTableReport?
|
241
|
+
def model_klass: () -> Class
|
101
242
|
|
102
|
-
|
103
|
-
def preload_associations: -> Array[untyped]
|
104
|
-
def eager_load_associations: -> Array[untyped]
|
105
|
-
def build_records_from_csv: (Array[Array[String?]] csv, Hash[Integer, untyped] old_records_by_id) -> Hash[Integer, untyped]
|
106
|
-
def enable_foreign_key_checks: -> untyped
|
107
|
-
def disable_foreign_key_checks: -> untyped
|
108
|
-
end
|
243
|
+
def self.build: (spec_name: String, master_data_file: MasterDataFile) -> MasterDataStatus
|
109
244
|
|
110
|
-
|
111
|
-
|
245
|
+
def self.import_records!: (records: [MasterDataStatus], dry_run: bool) -> nil
|
246
|
+
|
247
|
+
def self.decide_version: (Pathname csv_path) -> String
|
112
248
|
|
113
|
-
def
|
114
|
-
def append: (MasterData master_data) -> Array[MasterData]
|
115
|
-
def each: ?{ (MasterData) -> (Array[MasterDataStatus | {operation: :verify, table_name: untyped, valid: untyped, id: untyped}]?) } -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
116
|
-
def to_a: -> Array[MasterData]
|
249
|
+
def self.import_columns: () -> Array[String]
|
117
250
|
end
|
118
251
|
|
119
252
|
module Report
|
120
253
|
module Printer
|
121
254
|
attr_reader spec_config: SpecConfig
|
122
|
-
|
123
|
-
|
124
|
-
|
255
|
+
|
256
|
+
attr_accessor silent: bool
|
257
|
+
|
258
|
+
def initialize: (spec_config: SpecConfig, silent: bool) -> void
|
259
|
+
|
260
|
+
def print: (message: String) -> nil
|
125
261
|
end
|
126
262
|
|
127
263
|
class DefaultPrinter
|
128
264
|
include Printer
|
129
265
|
|
130
|
-
def print: (String
|
266
|
+
def print: (message: String) -> nil
|
131
267
|
end
|
132
268
|
|
133
269
|
module Core
|
134
|
-
|
135
|
-
|
270
|
+
attr_reader master_data: MasterData
|
271
|
+
|
272
|
+
def initialize: (master_data: MasterData) -> void
|
273
|
+
|
274
|
+
def print: (printer: Printer) -> untyped
|
136
275
|
|
137
276
|
private
|
138
|
-
|
277
|
+
|
278
|
+
def convert_to_ltsv: ({ operation: :affected_table, table_name: String } items) -> String
|
139
279
|
end
|
140
280
|
|
141
281
|
class ImportReport
|
142
282
|
include Core
|
143
|
-
@master_data: MasterData
|
144
283
|
|
145
|
-
|
146
|
-
|
147
|
-
def print: (Printer
|
284
|
+
def reports: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
285
|
+
|
286
|
+
def print: (printer: Printer) -> untyped
|
148
287
|
|
149
288
|
private
|
150
|
-
|
151
|
-
def
|
152
|
-
|
153
|
-
def
|
154
|
-
|
289
|
+
|
290
|
+
def count_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
291
|
+
|
292
|
+
def new_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
293
|
+
|
294
|
+
def updated_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
295
|
+
|
296
|
+
def no_change_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
297
|
+
|
298
|
+
def deleted_records_report: () -> Hash[Symbol, Array[Hash[untyped, untyped]]]
|
155
299
|
end
|
156
300
|
|
157
301
|
class VerifyReport
|
158
302
|
include Core
|
159
|
-
@master_data: MasterData
|
160
303
|
|
161
|
-
attr_reader reports: Array[{operation: :verify, table_name:
|
162
|
-
|
163
|
-
def
|
164
|
-
|
165
|
-
def
|
304
|
+
attr_reader reports: Array[{ operation: :verify, table_name: String, valid: bool, id: Integer }]
|
305
|
+
|
306
|
+
def initialize: (master_data: MasterData) -> void
|
307
|
+
|
308
|
+
def append: (report: { operation: :verify, table_name: String, valid: bool, id: Integer }) -> Array[{ operation: :verify, table_name: String, valid: bool, id: Integer }]
|
309
|
+
|
310
|
+
def print: (printer: Printer) -> untyped
|
311
|
+
|
312
|
+
def self.build_verify_record_report: (master_data: MasterData, record: ActiveRecord::Base, valid: bool) -> { operation: :verify, table_name: String, valid: bool, id: Integer }
|
166
313
|
end
|
167
314
|
|
168
315
|
class PrintAffectedTableReport
|
169
316
|
include Core
|
170
|
-
@master_data: MasterData
|
171
317
|
|
172
|
-
def print: (Printer
|
318
|
+
def print: (printer: Printer) -> untyped
|
173
319
|
end
|
174
320
|
end
|
175
321
|
|
176
|
-
|
322
|
+
class SpecConfig
|
323
|
+
attr_accessor spec_name: String
|
324
|
+
attr_accessor application_record_class: Class
|
325
|
+
attr_accessor import_config: Import::Config?
|
326
|
+
attr_accessor verify_config: Verify::Config?
|
327
|
+
attr_accessor dump_config: Dump::Config?
|
328
|
+
attr_accessor logger: Logger
|
329
|
+
|
330
|
+
def initialize: (spec_name: String, application_record_class: Class, import_config: Import::Config?, verify_config: Verify::Config?, dump_config: Dump::Config?, logger: Logger) -> void
|
331
|
+
|
332
|
+
def configure: () -> SpecConfig
|
333
|
+
end
|
334
|
+
|
335
|
+
module Verify
|
336
|
+
class Config
|
337
|
+
DEFAULT_VALUES: { only_tables: Array[String], except_tables: Array[String], preload_belongs_to_associations: bool, preload_associations: Hash[Class, Array[Symbol]], eager_load_associations: Hash[Class, Array[Symbol]] }
|
338
|
+
|
339
|
+
attr_accessor only_tables: Array[String]
|
340
|
+
attr_accessor except_tables: Array[String]
|
341
|
+
attr_accessor preload_belongs_to_associations: bool
|
342
|
+
attr_accessor preload_associations: Hash[Class, Array[Symbol]]
|
343
|
+
attr_accessor eager_load_associations: Hash[Class, Array[Symbol]]
|
344
|
+
|
345
|
+
def initialize: (only_tables: Array[String], except_tables: Array[String], preload_belongs_to_associations: bool, preload_associations: Hash[Class, Array[Symbol]], eager_load_associations: Hash[Class, Array[Symbol]]) -> void
|
346
|
+
|
347
|
+
def skip_table?: (String table_name) -> bool
|
348
|
+
|
349
|
+
def configure: () -> Config
|
350
|
+
|
351
|
+
def self.default_config: () -> Config
|
352
|
+
end
|
353
|
+
|
177
354
|
class Executor
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
@ignore_empty_table: bool
|
182
|
-
@ignore_tables: Array[String]
|
183
|
-
@ignore_column_names: Array[String]
|
184
|
-
@only_tables: Array[String]
|
185
|
-
@verbose: bool
|
186
|
-
|
187
|
-
def initialize: (spec_config: SpecConfig, ignore_empty_table: bool, ignore_tables: Array[String], ignore_column_names: Array[String], only_tables: Array[String], verbose: bool) -> void
|
188
|
-
def execute: -> Array[untyped]
|
355
|
+
def initialize: (spec_config: SpecConfig, verify_config: Verify::Config?, silent: bool, override_identifier: String?, report_printer: Report::Printer?) -> void
|
356
|
+
|
357
|
+
def execute: () -> untyped
|
189
358
|
|
190
359
|
private
|
191
|
-
def print_message: (String message) -> nil
|
192
|
-
def dump_to_csv: (untyped table) -> nil
|
193
|
-
def ignore?: (untyped model_klass) -> false
|
194
360
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
361
|
+
attr_reader spec_config: SpecConfig
|
362
|
+
attr_reader verify_config: Verify::Config
|
363
|
+
attr_reader silent: bool
|
364
|
+
attr_reader override_identifier: String?
|
365
|
+
attr_reader report_printer: Report::DefaultPrinter
|
366
|
+
|
367
|
+
def build_master_data_collection: () -> MasterDataCollection
|
199
368
|
end
|
200
369
|
end
|
201
370
|
|
202
|
-
module
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
@only_verify_tables: Array[String]
|
210
|
-
@except_verify_tables: Array[String]
|
211
|
-
@skip_no_change: bool
|
212
|
-
@silent: bool
|
213
|
-
@delete_all_ignore_foreign_key: bool
|
214
|
-
@override_identifier: String?
|
215
|
-
@report_printer: Report::DefaultPrinter
|
216
|
-
@master_data_statuses: [MasterDataStatus]
|
217
|
-
|
218
|
-
def initialize: (spec_config: SpecConfig, dry_run: bool, verify: bool, only_import_tables: Array[String], except_import_tables: Array[String], only_verify_tables: Array[String], except_verify_tables: Array[String], skip_no_change: bool, silent: bool, delete_all_ignore_foreign_key: bool, override_identifier: String?, report_printer: Report::Printer) -> void
|
219
|
-
def execute: -> nil
|
371
|
+
module Command
|
372
|
+
module Import
|
373
|
+
extend ActiveSupport::Concern
|
374
|
+
|
375
|
+
def import: () -> untyped
|
376
|
+
|
377
|
+
def import_all: () -> untyped
|
220
378
|
|
221
379
|
private
|
222
|
-
|
223
|
-
def
|
224
|
-
def import_all!: (MasterDataCollection master_data_collection) -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
225
|
-
def verify_all!: (MasterDataCollection master_data_collection) -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
226
|
-
def save_master_data_statuses!: (MasterDataCollection master_data_collection) -> Array[MasterDataStatus]
|
227
|
-
def print_affected_tables: (MasterDataCollection master_data_collection) -> (Array[MasterData] | Enumerator[MasterData, untyped] | Enumerator[untyped, untyped])
|
228
|
-
def load_skip_table?: (untyped master_data_file) -> bool
|
229
|
-
def import_skip_table?: (untyped table_name) -> bool
|
230
|
-
def verify_skip_table?: (untyped table_name) -> bool
|
231
|
-
def need_skip_table?: (untyped table_name, Array[untyped] only, Array[untyped] except) -> bool
|
232
|
-
def extract_master_data_csv_paths: -> Array[Pathname]
|
233
|
-
def overridden_master_data_csv_paths: -> Array[Pathname]
|
234
|
-
def master_data_statuses: -> untyped
|
380
|
+
|
381
|
+
def build_import_executor: (SpecConfig spec_config) -> untyped
|
235
382
|
end
|
236
|
-
end
|
237
383
|
|
238
|
-
|
239
|
-
|
384
|
+
module Verify
|
385
|
+
extend ActiveSupport::Concern
|
240
386
|
|
241
|
-
|
242
|
-
end
|
387
|
+
def verify: () -> untyped
|
243
388
|
|
244
|
-
|
245
|
-
|
389
|
+
def verify_all: () -> untyped
|
390
|
+
|
391
|
+
private
|
392
|
+
|
393
|
+
def build_verify_executor: (SpecConfig spec_config) -> untyped
|
394
|
+
end
|
246
395
|
|
247
|
-
|
248
|
-
|
396
|
+
module Dump
|
397
|
+
extend ActiveSupport::Concern
|
398
|
+
|
399
|
+
def dump: () -> nil
|
400
|
+
end
|
249
401
|
end
|
250
402
|
end
|