eac_tools 0.45.2 → 0.47.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +42 -36
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/lib/avm/data/callbacks.rb +37 -0
  5. data/sub/avm/lib/avm/data/package.rb +15 -7
  6. data/sub/avm/lib/avm/data/unit.rb +2 -23
  7. data/sub/avm/lib/avm/instances/base/auto_values/data.rb +1 -1
  8. data/sub/avm/lib/avm/instances/data/files_unit.rb +55 -0
  9. data/sub/avm/lib/avm/{data/instance → instances/data}/package.rb +2 -2
  10. data/sub/avm/lib/avm/instances/data/unit.rb +14 -0
  11. data/sub/avm/lib/avm/instances/data.rb +11 -0
  12. data/sub/avm/lib/avm/version.rb +1 -1
  13. data/sub/avm-eac_php_base0/avm-eac_php_base0.gemspec +3 -2
  14. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/instances/base.rb +14 -0
  15. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/instances.rb +11 -0
  16. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/source_generators/base.rb +28 -0
  17. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/source_generators.rb +11 -0
  18. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/sources/base.rb +17 -0
  19. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/sources.rb +11 -0
  20. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/version.rb +1 -1
  21. data/sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/source_generators/base_spec.rb +8 -0
  22. data/sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/source_generators/base_spec_files/no_options/index.php +0 -0
  23. data/sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/sources/base_spec.rb +7 -0
  24. data/sub/avm-eac_php_base0/template/avm/eac_php_base0/source_generators/base/index.php +0 -0
  25. data/sub/avm-eac_postgresql_base0/Gemfile +5 -0
  26. data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +19 -0
  27. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/assert.rb +77 -0
  28. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +39 -0
  29. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb +74 -0
  30. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb +18 -0
  31. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +7 -0
  32. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0.rb +9 -0
  33. data/sub/avm-eac_postgresql_base0/spec/rubocop_spec.rb +3 -0
  34. data/sub/avm-eac_postgresql_base0/spec/spec_helper.rb +4 -0
  35. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
  36. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  37. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -2
  38. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb +22 -0
  39. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +11 -0
  40. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb +37 -0
  41. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +3 -9
  42. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/data_package.rb +23 -0
  43. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +1 -19
  44. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  45. data/sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec +2 -2
  46. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/init.rb +27 -0
  47. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/parent.rb +31 -0
  48. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/rubocop.rb +29 -0
  49. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/version.rb +31 -0
  50. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb +2 -36
  51. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/init_file.rb +43 -0
  52. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb +1 -1
  53. data/sub/avm-eac_redmine_plugin_base0/spec/lib/avm/eac_redmine_plugin_base0/sources/init_file_spec.rb +14 -0
  54. data/sub/avm-eac_redmine_plugin_base0/spec/lib/avm/eac_redmine_plugin_base0/sources/init_file_spec_files/a_init_file.rb +12 -0
  55. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +3 -3
  56. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +4 -4
  57. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  58. data/sub/avm-git/avm-git.gemspec +3 -3
  59. data/sub/avm-git/lib/avm/git/launcher/base/underlying.rb +1 -1
  60. data/sub/avm-git/lib/avm/git/version.rb +1 -1
  61. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/append_command_options.rb +38 -0
  62. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/concat.rb +17 -2
  63. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/debugging.rb +19 -0
  64. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb +3 -0
  65. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/execution.rb +52 -0
  66. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +28 -84
  67. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/{command/exec_error.rb → execution_error.rb} +1 -3
  68. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/execution_result.rb +45 -0
  69. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  70. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command_spec.rb +93 -0
  71. metadata +61 -39
  72. data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -41
  73. data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
  74. data/sub/avm/lib/avm/data/instance.rb +0 -11
  75. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/data_unit.rb +0 -53
  76. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/execute_result.rb +0 -47
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.45.2
4
+ version: 0.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-15 00:00:00.000000000 Z
11
+ date: 2022-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.56'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.56.1
19
+ version: '0.58'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.56'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.56.1
26
+ version: '0.58'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: avm-eac_asciidoctor_base0
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +72,14 @@ dependencies:
78
72
  requirements:
79
73
  - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: '0.3'
75
+ version: '0.4'
82
76
  type: :runtime
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
80
  - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: '0.3'
82
+ version: '0.4'
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: avm-eac_rails_base0
91
85
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +107,9 @@ dependencies:
113
107
  - - "~>"
114
108
  - !ruby/object:Gem::Version
115
109
  version: '0.7'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 0.7.1
116
113
  type: :runtime
117
114
  prerelease: false
118
115
  version_requirements: !ruby/object:Gem::Requirement
@@ -120,40 +117,37 @@ dependencies:
120
117
  - - "~>"
121
118
  - !ruby/object:Gem::Version
122
119
  version: '0.7'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 0.7.1
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: avm-eac_redmine_base0
125
125
  requirement: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '0.16'
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- version: 0.16.1
129
+ version: '0.17'
133
130
  type: :runtime
134
131
  prerelease: false
135
132
  version_requirements: !ruby/object:Gem::Requirement
136
133
  requirements:
137
134
  - - "~>"
138
135
  - !ruby/object:Gem::Version
139
- version: '0.16'
140
- - - ">="
141
- - !ruby/object:Gem::Version
142
- version: 0.16.1
136
+ version: '0.17'
143
137
  - !ruby/object:Gem::Dependency
144
138
  name: avm-eac_redmine_plugin_base0
145
139
  requirement: !ruby/object:Gem::Requirement
146
140
  requirements:
147
141
  - - "~>"
148
142
  - !ruby/object:Gem::Version
149
- version: '0.3'
143
+ version: '0.4'
150
144
  type: :runtime
151
145
  prerelease: false
152
146
  version_requirements: !ruby/object:Gem::Requirement
153
147
  requirements:
154
148
  - - "~>"
155
149
  - !ruby/object:Gem::Version
156
- version: '0.3'
150
+ version: '0.4'
157
151
  - !ruby/object:Gem::Dependency
158
152
  name: avm-eac_ruby_base1
159
153
  requirement: !ruby/object:Gem::Requirement
@@ -183,7 +177,7 @@ dependencies:
183
177
  version: '0.12'
184
178
  - - ">="
185
179
  - !ruby/object:Gem::Version
186
- version: 0.12.2
180
+ version: 0.12.3
187
181
  type: :runtime
188
182
  prerelease: false
189
183
  version_requirements: !ruby/object:Gem::Requirement
@@ -193,7 +187,7 @@ dependencies:
193
187
  version: '0.12'
194
188
  - - ">="
195
189
  - !ruby/object:Gem::Version
196
- version: 0.12.2
190
+ version: 0.12.3
197
191
  - !ruby/object:Gem::Dependency
198
192
  name: avm-eac_wordpress_base0
199
193
  requirement: !ruby/object:Gem::Requirement
@@ -240,20 +234,14 @@ dependencies:
240
234
  requirements:
241
235
  - - "~>"
242
236
  - !ruby/object:Gem::Version
243
- version: '0.107'
244
- - - ">="
245
- - !ruby/object:Gem::Version
246
- version: 0.107.1
237
+ version: '0.108'
247
238
  type: :runtime
248
239
  prerelease: false
249
240
  version_requirements: !ruby/object:Gem::Requirement
250
241
  requirements:
251
242
  - - "~>"
252
243
  - !ruby/object:Gem::Version
253
- version: '0.107'
254
- - - ">="
255
- - !ruby/object:Gem::Version
256
- version: 0.107.1
244
+ version: '0.108'
257
245
  - !ruby/object:Gem::Dependency
258
246
  name: eac_ruby_gem_support
259
247
  requirement: !ruby/object:Gem::Requirement
@@ -426,6 +414,12 @@ files:
426
414
  - sub/avm-eac_php_base0/lib/avm/eac_php_base0/executables.rb
427
415
  - sub/avm-eac_php_base0/lib/avm/eac_php_base0/file_formats.rb
428
416
  - sub/avm-eac_php_base0/lib/avm/eac_php_base0/file_formats/base.rb
417
+ - sub/avm-eac_php_base0/lib/avm/eac_php_base0/instances.rb
418
+ - sub/avm-eac_php_base0/lib/avm/eac_php_base0/instances/base.rb
419
+ - sub/avm-eac_php_base0/lib/avm/eac_php_base0/source_generators.rb
420
+ - sub/avm-eac_php_base0/lib/avm/eac_php_base0/source_generators/base.rb
421
+ - sub/avm-eac_php_base0/lib/avm/eac_php_base0/sources.rb
422
+ - sub/avm-eac_php_base0/lib/avm/eac_php_base0/sources/base.rb
429
423
  - sub/avm-eac_php_base0/lib/avm/eac_php_base0/version.rb
430
424
  - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/file_formats/base_spec.rb
431
425
  - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/file_formats/base_spec_files/php_code.php.source
@@ -436,8 +430,22 @@ files:
436
430
  - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/file_formats/base_spec_files/php_html_code.php.target
437
431
  - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/file_formats/base_spec_files/php_iso88591_code.php.source
438
432
  - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/file_formats/base_spec_files/php_iso88591_code.php.target
433
+ - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/source_generators/base_spec.rb
434
+ - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/source_generators/base_spec_files/no_options/index.php
435
+ - sub/avm-eac_php_base0/spec/lib/avm/eac_php_base0/sources/base_spec.rb
439
436
  - sub/avm-eac_php_base0/spec/rubocop_spec.rb
440
437
  - sub/avm-eac_php_base0/spec/spec_helper.rb
438
+ - sub/avm-eac_php_base0/template/avm/eac_php_base0/source_generators/base/index.php
439
+ - sub/avm-eac_postgresql_base0/Gemfile
440
+ - sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec
441
+ - sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0.rb
442
+ - sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
443
+ - sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/assert.rb
444
+ - sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb
445
+ - sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb
446
+ - sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb
447
+ - sub/avm-eac_postgresql_base0/spec/rubocop_spec.rb
448
+ - sub/avm-eac_postgresql_base0/spec/spec_helper.rb
441
449
  - sub/avm-eac_python_base0/Gemfile
442
450
  - sub/avm-eac_python_base0/avm-eac_python_base0.gemspec
443
451
  - sub/avm-eac_python_base0/lib/avm/eac_python_base0.rb
@@ -532,9 +540,11 @@ files:
532
540
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/apache_host.rb
533
541
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
534
542
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb
543
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb
535
544
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb
545
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb
536
546
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/web.rb
537
- - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/data_unit.rb
547
+ - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/data_package.rb
538
548
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb
539
549
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb
540
550
  - sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api.rb
@@ -570,7 +580,14 @@ files:
570
580
  - sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec
571
581
  - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0.rb
572
582
  - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb
583
+ - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/init.rb
584
+ - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/parent.rb
585
+ - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/rubocop.rb
586
+ - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/version.rb
587
+ - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/init_file.rb
573
588
  - sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb
589
+ - sub/avm-eac_redmine_plugin_base0/spec/lib/avm/eac_redmine_plugin_base0/sources/init_file_spec.rb
590
+ - sub/avm-eac_redmine_plugin_base0/spec/lib/avm/eac_redmine_plugin_base0/sources/init_file_spec_files/a_init_file.rb
574
591
  - sub/avm-eac_redmine_plugin_base0/spec/rubocop_spec.rb
575
592
  - sub/avm-eac_redmine_plugin_base0/spec/spec_helper.rb
576
593
  - sub/avm-eac_ruby_base1/Gemfile
@@ -982,10 +999,7 @@ files:
982
999
  - sub/avm/lib/avm/applications/base.rb
983
1000
  - sub/avm/lib/avm/applications/base/publishing.rb
984
1001
  - sub/avm/lib/avm/applications/base/stereotype.rb
985
- - sub/avm/lib/avm/data/instance.rb
986
- - sub/avm/lib/avm/data/instance/files_unit.rb
987
- - sub/avm/lib/avm/data/instance/package.rb
988
- - sub/avm/lib/avm/data/instance/unit.rb
1002
+ - sub/avm/lib/avm/data/callbacks.rb
989
1003
  - sub/avm/lib/avm/data/package.rb
990
1004
  - sub/avm/lib/avm/data/package/dump.rb
991
1005
  - sub/avm/lib/avm/data/package/load.rb
@@ -1035,6 +1049,10 @@ files:
1035
1049
  - sub/avm/lib/avm/instances/base/entry_keys.rb
1036
1050
  - sub/avm/lib/avm/instances/base/install.rb
1037
1051
  - sub/avm/lib/avm/instances/base/web.rb
1052
+ - sub/avm/lib/avm/instances/data.rb
1053
+ - sub/avm/lib/avm/instances/data/files_unit.rb
1054
+ - sub/avm/lib/avm/instances/data/package.rb
1055
+ - sub/avm/lib/avm/instances/data/unit.rb
1038
1056
  - sub/avm/lib/avm/instances/docker_image.rb
1039
1057
  - sub/avm/lib/avm/instances/entry_keys.rb
1040
1058
  - sub/avm/lib/avm/instances/ids.rb
@@ -1578,12 +1596,15 @@ files:
1578
1596
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs.rb
1579
1597
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_env.rb
1580
1598
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb
1599
+ - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/append_command_options.rb
1581
1600
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/concat.rb
1601
+ - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/debugging.rb
1582
1602
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
1583
- - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/exec_error.rb
1584
- - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/execute_result.rb
1603
+ - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/execution.rb
1585
1604
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb
1586
1605
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb
1606
+ - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/execution_error.rb
1607
+ - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/execution_result.rb
1587
1608
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/file.rb
1588
1609
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/local_env.rb
1589
1610
  - sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
@@ -1729,6 +1750,7 @@ files:
1729
1750
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compare_by_spec.rb
1730
1751
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/custom_format_spec.rb
1731
1752
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/enum_spec.rb
1753
+ - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command_spec.rb
1732
1754
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/executable_spec.rb
1733
1755
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/ssh_env_spec.rb
1734
1756
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/instance/unit'
4
-
5
- module Avm
6
- module Data
7
- module Instance
8
- class FilesUnit < ::Avm::Data::Instance::Unit
9
- EXTENSION = '.tar.gz'
10
-
11
- attr_reader :fs_path_subpath
12
-
13
- def initialize(instance, fs_path_subpath)
14
- super(instance)
15
- @fs_path_subpath = fs_path_subpath
16
- end
17
-
18
- before_load :clear_files
19
-
20
- def files_path
21
- ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
22
- fs_path_subpath)
23
- end
24
-
25
- def dump_command
26
- instance.host_env.command('tar', '-czf', '-', '-C', files_path, '.')
27
- end
28
-
29
- def load_command
30
- instance.host_env.command('tar', '-xzf', '-', '-C', files_path)
31
- end
32
-
33
- def clear_files
34
- infom "Removing all files under #{files_path}..."
35
- instance.host_env.command('mkdir', '-p', files_path).execute!
36
- instance.host_env.command('find', files_path, '-mindepth', 1, '-delete').execute!
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/unit'
4
-
5
- module Avm
6
- module Data
7
- module Instance
8
- class Unit < ::Avm::Data::Unit
9
- attr_reader :instance
10
-
11
- def initialize(instance)
12
- @instance = instance
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/require_sub'
4
- ::EacRubyUtils.require_sub(__FILE__)
5
-
6
- module Avm
7
- module Data
8
- module Instance
9
- end
10
- end
11
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/instance/unit'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'curb'
6
- require 'open-uri'
7
-
8
- module Avm
9
- module EacRedmineBase0
10
- module Instances
11
- class DataUnit < ::Avm::Data::Instance::Unit
12
- common_constructor :instance
13
-
14
- EXPORT_PATH = '/backup/export'
15
- EXTENSION = '.tar'
16
- IMPORT_PATH = '/backup/import.json'
17
-
18
- def do_dump(data_path)
19
- ::File.open(data_path, 'wb') do |file|
20
- file << export_request.response.body_data_or_raise
21
- end
22
- end
23
-
24
- def do_load(data_path)
25
- do_load_by_web(data_path) || do_load_by_rake(data_path) || raise('Failed to load')
26
- end
27
-
28
- def do_load_by_web(data_path)
29
- c = Curl::Easy.new(import_url)
30
- c.multipart_form_post = true
31
- c.http_post(Curl::PostField.file('redmine_with_git_tableless_load[path]', data_path))
32
- c.perform
33
- true
34
- rescue Curl::Err::ConnectionFailedError
35
- false
36
- end
37
-
38
- def do_load_by_rake(data_path)
39
- instance.bundle('exec', 'rake', "redmine_with_git:load:all[#{data_path}]").system
40
- true
41
- end
42
-
43
- def export_request
44
- instance.rest_api.request(EXPORT_PATH)
45
- end
46
-
47
- def import_url
48
- instance.rest_api.build_service_url(IMPORT_PATH).to_s
49
- end
50
- end
51
- end
52
- end
53
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/envs/command/exec_error'
4
-
5
- module EacRubyUtils
6
- module Envs
7
- class Command
8
- class ExecuteResult
9
- attr_reader :r, :options
10
-
11
- def initialize(result, options)
12
- @r = result
13
- @options = options
14
- end
15
-
16
- def result
17
- return exit_code_zero_result if exit_code_zero?
18
- return expected_error_result if expected_error?
19
-
20
- raise ::EacRubyUtils::Envs::Command::ExecError, 'Failed!'
21
- end
22
-
23
- def success?
24
- exit_code_zero? || expected_error?
25
- end
26
-
27
- private
28
-
29
- def exit_code_zero?
30
- r[:exit_code]&.zero?
31
- end
32
-
33
- def exit_code_zero_result
34
- r[options[:output] || :stdout]
35
- end
36
-
37
- def expected_error_result
38
- options[:exit_outputs][r[:exit_code]]
39
- end
40
-
41
- def expected_error?
42
- options[:exit_outputs].is_a?(Hash) && options[:exit_outputs].key?(r[:exit_code])
43
- end
44
- end
45
- end
46
- end
47
- end