eac_tools 0.63.0 → 0.64.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +32 -32
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +2 -2
  5. data/sub/avm/lib/avm/instances/base/subcommand_parent.rb +25 -0
  6. data/sub/avm/lib/avm/instances/data/unit.rb +12 -0
  7. data/sub/avm/lib/avm/instances/entry_keys.rb +1 -0
  8. data/sub/avm/lib/avm/version.rb +1 -1
  9. data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +2 -2
  10. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +4 -4
  11. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb +0 -4
  12. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb +5 -0
  13. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +1 -1
  14. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +3 -3
  15. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +2 -10
  16. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +3 -1
  17. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  18. data/sub/avm-tools/avm-tools.gemspec +11 -11
  19. data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/dump.rb +11 -6
  20. data/sub/avm-tools/lib/avm/tools/runner/instance/data/load.rb +58 -0
  21. data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/unit/clear.rb +4 -3
  22. data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/dump.rb +41 -0
  23. data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/unit.rb +6 -5
  24. data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data.rb +4 -3
  25. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  26. data/sub/eac_cli/eac_cli.gemspec +1 -1
  27. data/sub/eac_cli/lib/eac_cli/definition/base_option.rb +3 -1
  28. data/sub/eac_cli/lib/eac_cli/definition/default_value.rb +17 -0
  29. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +8 -26
  30. data/sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb +40 -0
  31. data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +12 -0
  32. data/sub/eac_cli/lib/eac_cli/runner_with/input.rb +1 -1
  33. data/sub/eac_cli/lib/eac_cli/runner_with/output.rb +1 -1
  34. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +1 -4
  35. data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
  36. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb +21 -0
  37. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +0 -1
  38. data/sub/eac_ruby_utils/lib/eac_ruby_utils/{abstract_methods.rb → acts_as_abstract.rb} +4 -4
  39. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/abstract.rb +2 -2
  40. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +3 -3
  41. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_abstract.rb +14 -0
  42. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +5 -1
  43. data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +2 -2
  44. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  45. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{abstract_methods_spec.rb → acts_as_abstract_spec.rb} +2 -2
  46. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/abstract_spec.rb +1 -1
  47. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/acts_as_abstract_spec.rb +14 -0
  48. metadata +26 -29
  49. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb +0 -26
  50. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/unit/dump.rb +0 -25
  51. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/unit/load.rb +0 -25
  52. data/sub/eac_cli/lib/eac_cli/runner_with/help/list_section.rb +0 -22
  53. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/list_section_spec.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e107f6aa74ee0e1e360adc2984d3c2a68aea45023eb92fd0c2612b3f99231fcd
4
- data.tar.gz: 4ec44416302a162992af3a0410033895e2a3179847d285cdf295b4c1e303af10
3
+ metadata.gz: 514082c79fd68acecc065cb4bfcac5debaa5e114e3a53e64962888d0b2cb2ebd
4
+ data.tar.gz: bdbc2be06b220888e839844b9562fed56431c3dd5b70ebc771a18ab5a6809ca1
5
5
  SHA512:
6
- metadata.gz: a89a40d5ceefd62730be561a0bf3305bfacdcdf71ad65c77fbb9e2d04f6e31592e12a54efc2dfcac24f0a39bdd0fdeda2d8a94200c0fd9b8141f45a47b2b3469
7
- data.tar.gz: 8e2546581a3d82e9d3d984894e35cc40941364e338c39433e9bfd9cb169222b9f3277042523293ea04e4aa87401d8b4b32f039552c03a101e29e33f61c0f6f0e
6
+ metadata.gz: e6674ee3ea87209102c847f980c389666c0bc02d5e82252bc962beb86cebfa58f0bfcd8ff498ee4bdb7db79b56238953c11f1e02d40f3fa43342589a8ab5d1c6
7
+ data.tar.gz: 203ae1b9a4a08408f276adf59c5dd4ba0fab61137653200a5c71f3b0620afca96b5b0500b0ec9fe7762e1fcaeed11a4d77b84e6bc46756a89c03b69f454bda46
data/Gemfile.lock CHANGED
@@ -1,24 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.63.0)
5
- avm (~> 0.69)
4
+ eac_tools (0.64.0)
5
+ avm (~> 0.70)
6
6
  avm-eac_asciidoctor_base0 (~> 0.19)
7
7
  avm-eac_generic_base0 (~> 0.12)
8
8
  avm-eac_latex_base0 (~> 0.3, >= 0.3.1)
9
9
  avm-eac_php_base0 (~> 0.4, >= 0.4.2)
10
- avm-eac_postgresql_base0 (~> 0.4)
10
+ avm-eac_postgresql_base0 (~> 0.5)
11
11
  avm-eac_python_base0 (~> 0.2, >= 0.2.1)
12
12
  avm-eac_rails_base0 (~> 0.10, >= 0.10.2)
13
13
  avm-eac_rails_base1 (~> 0.8, >= 0.8.4)
14
14
  avm-eac_redmine_base0 (~> 0.20, >= 0.20.1)
15
15
  avm-eac_redmine_plugin_base0 (~> 0.4)
16
16
  avm-eac_ruby_base1 (~> 0.30, >= 0.30.2)
17
- avm-eac_webapp_base0 (~> 0.16)
17
+ avm-eac_webapp_base0 (~> 0.17)
18
18
  avm-eac_wordpress_base0 (~> 0.3, >= 0.3.1)
19
19
  avm-git (~> 0.13, >= 0.13.2)
20
- avm-tools (~> 0.145, >= 0.145.1)
21
- eac_ruby_utils (~> 0.113)
20
+ avm-tools (~> 0.146)
21
+ eac_ruby_utils (~> 0.114)
22
22
 
23
23
  PATH
24
24
  remote: sub/aranha-parsers
@@ -67,9 +67,9 @@ PATH
67
67
  PATH
68
68
  remote: sub/avm-eac_postgresql_base0
69
69
  specs:
70
- avm-eac_postgresql_base0 (0.4.0)
71
- avm (~> 0.69)
72
- eac_ruby_utils (~> 0.113)
70
+ avm-eac_postgresql_base0 (0.5.0)
71
+ avm (~> 0.70)
72
+ eac_ruby_utils (~> 0.114)
73
73
 
74
74
  PATH
75
75
  remote: sub/avm-eac_python_base0
@@ -134,13 +134,13 @@ PATH
134
134
  PATH
135
135
  remote: sub/avm-eac_webapp_base0
136
136
  specs:
137
- avm-eac_webapp_base0 (0.16.0)
138
- avm (~> 0.69)
137
+ avm-eac_webapp_base0 (0.17.0)
138
+ avm (~> 0.70)
139
139
  avm-eac_generic_base0 (~> 0.12)
140
- avm-eac_postgresql_base0 (~> 0.4)
140
+ avm-eac_postgresql_base0 (~> 0.5)
141
141
  avm-eac_ubuntu_base0 (~> 0.4, >= 0.4.2)
142
142
  avm-files (~> 0.6, >= 0.6.2)
143
- eac_ruby_utils (~> 0.113)
143
+ eac_ruby_utils (~> 0.114)
144
144
 
145
145
  PATH
146
146
  remote: sub/avm-eac_wordpress_base0
@@ -173,32 +173,32 @@ PATH
173
173
  PATH
174
174
  remote: sub/avm-tools
175
175
  specs:
176
- avm-tools (0.145.1)
177
- aranha-parsers (~> 0.14, >= 0.14.4)
178
- avm (~> 0.62)
179
- avm-eac_ruby_base1 (~> 0.29)
180
- avm-eac_ubuntu_base0 (~> 0.4)
181
- avm-files (~> 0.6)
182
- avm-git (~> 0.12)
176
+ avm-tools (0.146.0)
177
+ aranha-parsers (~> 0.17, >= 0.17.1)
178
+ avm (~> 0.70)
179
+ avm-eac_ruby_base1 (~> 0.30, >= 0.30.2)
180
+ avm-eac_ubuntu_base0 (~> 0.4, >= 0.4.2)
181
+ avm-files (~> 0.6, >= 0.6.2)
182
+ avm-git (~> 0.13, >= 0.13.2)
183
183
  clipboard (~> 1.3, >= 1.3.6)
184
184
  curb (~> 0.9, >= 0.9.11)
185
- eac_git (~> 0.14)
186
- eac_ruby_base0 (~> 0.17, >= 0.17.2)
187
- eac_templates (~> 0.3, >= 0.3.2)
188
- git (~> 1.13, >= 1.13.1)
189
- ruby-progressbar (~> 1.11)
185
+ eac_git (~> 0.14, >= 0.14.1)
186
+ eac_ruby_base0 (~> 0.18)
187
+ eac_templates (~> 0.5)
188
+ git (~> 1.18)
189
+ ruby-progressbar (~> 1.13)
190
190
 
191
191
  PATH
192
192
  remote: sub/avm
193
193
  specs:
194
- avm (0.69.0)
194
+ avm (0.70.0)
195
195
  aranha-parsers (~> 0.17, >= 0.17.1)
196
- eac_cli (~> 0.32)
196
+ eac_cli (~> 0.33)
197
197
  eac_config (~> 0.12)
198
198
  eac_docker (~> 0.7)
199
199
  eac_fs (~> 0.16)
200
200
  eac_git (~> 0.14, >= 0.14.1)
201
- eac_ruby_utils (~> 0.113)
201
+ eac_ruby_utils (~> 0.114)
202
202
  eac_templates (~> 0.5)
203
203
  filesize (~> 0.2)
204
204
  htmlbeautifier (~> 1.4, >= 1.4.2)
@@ -207,10 +207,10 @@ PATH
207
207
  PATH
208
208
  remote: sub/eac_cli
209
209
  specs:
210
- eac_cli (0.32.0)
210
+ eac_cli (0.33.0)
211
211
  colorize (~> 0.8, >= 0.8.1)
212
212
  eac_config (~> 0.12)
213
- eac_ruby_utils (~> 0.113)
213
+ eac_ruby_utils (~> 0.114)
214
214
 
215
215
  PATH
216
216
  remote: sub/eac_config
@@ -261,7 +261,7 @@ PATH
261
261
  PATH
262
262
  remote: sub/eac_ruby_utils
263
263
  specs:
264
- eac_ruby_utils (0.113.0)
264
+ eac_ruby_utils (0.114.0)
265
265
  activesupport (>= 4, < 7)
266
266
  addressable (~> 2.8, >= 2.8.4)
267
267
  bundler
@@ -335,7 +335,7 @@ GEM
335
335
  minitest (5.18.0)
336
336
  multipart-post (2.3.0)
337
337
  net-ssh (4.2.0)
338
- nokogiri (1.14.3-x86_64-linux)
338
+ nokogiri (1.14.4-x86_64-linux)
339
339
  racc (~> 1.4)
340
340
  ofx-parser (1.1.0)
341
341
  hpricot (>= 0.6)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.63.0'
4
+ VERSION = '0.64.0'
5
5
  end
data/sub/avm/avm.gemspec CHANGED
@@ -13,12 +13,12 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
15
  s.add_dependency 'aranha-parsers', '~> 0.17', '>= 0.17.1'
16
- s.add_dependency 'eac_cli', '~> 0.32'
16
+ s.add_dependency 'eac_cli', '~> 0.33'
17
17
  s.add_dependency 'eac_config', '~> 0.12'
18
18
  s.add_dependency 'eac_docker', '~> 0.7'
19
19
  s.add_dependency 'eac_fs', '~> 0.16'
20
20
  s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
21
- s.add_dependency 'eac_ruby_utils', '~> 0.113'
21
+ s.add_dependency 'eac_ruby_utils', '~> 0.114'
22
22
  s.add_dependency 'eac_templates', '~> 0.5'
23
23
  s.add_dependency 'filesize', '~> 0.2'
24
24
  s.add_dependency 'htmlbeautifier', '~> 1.4', '>= 1.4.2'
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner/context'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Instances
8
+ class Base
9
+ class SubcommandParent
10
+ enable_simple_cache
11
+ common_constructor :instance
12
+
13
+ private
14
+
15
+ def runner_context_uncached
16
+ ::EacCli::Runner::Context.new(self, argv: runner_argv)
17
+ end
18
+
19
+ def runner_argv
20
+ [instance.class.name.split('::')[-2].dasherize, instance.id]
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -8,6 +8,18 @@ module Avm
8
8
  module Data
9
9
  class Unit < ::Avm::Data::Unit
10
10
  common_constructor :instance
11
+
12
+ # @return [Pathname]
13
+ def data_default_dump_path
14
+ instance.data_default_dump_path.to_pathname.basename_sub('.*') do |b|
15
+ "#{b}_#{identifier}#{extension}"
16
+ end
17
+ end
18
+
19
+ # @return [String]
20
+ def identifier
21
+ instance.data_package.units.key(self) || raise("No identifier found for #{self}")
22
+ end
11
23
  end
12
24
  end
13
25
  end
@@ -28,6 +28,7 @@ module Avm
28
28
  {
29
29
  '' => %w[name source_instance_id],
30
30
  admin: URI_FIELDS + %w[api_key],
31
+ data: %w[default_dump_path],
31
32
  database: URI_FIELDS + %w[id limit name system timeout extra],
32
33
  docker: %w[registry],
33
34
  install: URI_FIELDS + %w[id data_path email groupname],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.69.0'
4
+ VERSION = '0.70.0'
5
5
  end
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.69'
16
- s.add_dependency 'eac_ruby_utils', '~> 0.113'
15
+ s.add_dependency 'avm', '~> 0.70'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.114'
17
17
 
18
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -26,11 +26,11 @@ module Avm
26
26
  end
27
27
 
28
28
  def dump_command
29
- instance.dump_gzip_command
29
+ instance.pg.dump_gzip_command
30
30
  end
31
31
 
32
32
  def load_command
33
- instance.load_gzip_command
33
+ instance.pg.load_gzip_command
34
34
  end
35
35
 
36
36
  private
@@ -49,7 +49,7 @@ module Avm
49
49
  end
50
50
 
51
51
  def run_sql(sql)
52
- instance.psql_command_command(sql).execute!
52
+ instance.pg.psql_command_command(sql).execute!
53
53
  end
54
54
 
55
55
  # @return [Array<String>]
@@ -60,7 +60,7 @@ module Avm
60
60
 
61
61
  # @return [String]
62
62
  def tables_sql
63
- TABLES_SQL.gsub(SCHEMA_VAR, instance.schema)
63
+ TABLES_SQL.gsub(SCHEMA_VAR, instance.pg.schema)
64
64
  end
65
65
  end
66
66
  end
@@ -21,10 +21,6 @@ module Avm
21
21
  ::Avm::EacPostgresqlBase0::Instance::Assert.new(self).perform
22
22
  end
23
23
 
24
- def data_unit
25
- ::Avm::EacPostgresqlBase0::Instance::DataUnit.new(self)
26
- end
27
-
28
24
  def host
29
25
  connection_params[:host] || DEFAULT_HOSTNAME
30
26
  end
@@ -15,6 +15,11 @@ module Avm
15
15
  name: database_name
16
16
  )
17
17
  end
18
+
19
+ # @return [Avm::EacPostgresqlBase0::Instance::DataUnit]
20
+ def pg_data_unit
21
+ ::Avm::EacPostgresqlBase0::Instance::DataUnit.new(self)
22
+ end
18
23
  end
19
24
  end
20
25
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacPostgresqlBase0
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
@@ -12,12 +12,12 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.69'
15
+ s.add_dependency 'avm', '~> 0.70'
16
16
  s.add_dependency 'avm-eac_generic_base0', '~> 0.12'
17
- s.add_dependency 'avm-eac_postgresql_base0', '~> 0.4'
17
+ s.add_dependency 'avm-eac_postgresql_base0', '~> 0.5'
18
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4', '>= 0.4.2'
19
19
  s.add_dependency 'avm-files', '~> 0.6', '>= 0.6.2'
20
- s.add_dependency 'eac_ruby_utils', '~> 0.113'
20
+ s.add_dependency 'eac_ruby_utils', '~> 0.114'
21
21
 
22
22
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
23
23
  end
@@ -15,18 +15,10 @@ module Avm
15
15
  include ::Avm::EacPostgresqlBase0::InstanceWith
16
16
  enable_simple_cache
17
17
 
18
- def data_dump(argv = [])
19
- run_subcommand(data_dump_runner_class, argv)
20
- end
21
-
22
- def data_dump_runner_class
23
- ::Avm::EacWebappBase0::Instances::Runners::Data::Dump
24
- end
25
-
26
18
  def run_subcommand(subcommand_class, argv)
27
19
  subcommand_class.create(
28
20
  argv: argv,
29
- parent: ::Avm::EacWebappBase0::Instances::Base::SubcommandParent.new(self)
21
+ parent: ::Avm::Instances::Base::SubcommandParent.new(self)
30
22
  ).run
31
23
  end
32
24
 
@@ -41,7 +33,7 @@ module Avm
41
33
  end
42
34
 
43
35
  def database_unit
44
- pg.data_unit
36
+ pg_data_unit
45
37
  end
46
38
 
47
39
  private
@@ -33,7 +33,9 @@ module Avm
33
33
  end
34
34
 
35
35
  def source_instance_dump_path
36
- runner_context.call(:instance).class.by_id(parsed.source_instance).data_dump
36
+ runner_context.call(:instance).class.by_id(parsed.source_instance).run_subcommand(
37
+ ::Avm::EacWebappBase0::Instances::Runners::Data::Dump, []
38
+ )
37
39
  end
38
40
 
39
41
  def load_dump
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWebappBase0
5
- VERSION = '0.16.0'
5
+ VERSION = '0.17.0'
6
6
  end
7
7
  end
@@ -14,19 +14,19 @@ Gem::Specification.new do |s|
14
14
  s.bindir = 'exe'
15
15
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
16
16
 
17
- s.add_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.4'
18
- s.add_dependency 'avm', '~> 0.62'
19
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.29'
20
- s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4'
21
- s.add_dependency 'avm-files', '~> 0.6'
22
- s.add_dependency 'avm-git', '~> 0.12'
17
+ s.add_dependency 'aranha-parsers', '~> 0.17', '>= 0.17.1'
18
+ s.add_dependency 'avm', '~> 0.70'
19
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.30', '>= 0.30.2'
20
+ s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4', '>= 0.4.2'
21
+ s.add_dependency 'avm-files', '~> 0.6', '>= 0.6.2'
22
+ s.add_dependency 'avm-git', '~> 0.13', '>= 0.13.2'
23
23
  s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.6'
24
24
  s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
25
- s.add_dependency 'eac_git', '~> 0.14'
26
- s.add_dependency 'eac_ruby_base0', '~> 0.17', '>= 0.17.2'
27
- s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
28
- s.add_dependency 'git', '~> 1.13', '>= 1.13.1'
29
- s.add_dependency 'ruby-progressbar', '~> 1.11'
25
+ s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
26
+ s.add_dependency 'eac_ruby_base0', '~> 0.18'
27
+ s.add_dependency 'eac_templates', '~> 0.5'
28
+ s.add_dependency 'git', '~> 1.18'
29
+ s.add_dependency 'ruby-progressbar', '~> 1.13'
30
30
 
31
31
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
32
32
  end
@@ -1,23 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/data/package/dump'
4
+ require 'avm/instances/runner'
4
5
  require 'eac_cli/core_ext'
5
6
 
6
7
  module Avm
7
- module EacWebappBase0
8
- module Instances
9
- module Runners
8
+ module Tools
9
+ class Runner
10
+ class Instance < ::Avm::Instances::Runner
10
11
  class Data
11
12
  class Dump
12
13
  DUMP_EXPIRE_TIME = 1.day
13
- DEFAULT_DUMP_PATH_ENTRY_SUFFIX = 'data.default_dump_path'
14
14
  NO_DUMP_MESSAGE = 'Dump "%s" already exist and rewrite options was no setted nor ' \
15
15
  'dump was expired.'
16
16
 
17
17
  runner_with :help do
18
18
  desc 'Dump utility for EacRailsBase instance.'
19
19
  bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
20
- arg_opt '-p', '--dump-path', 'Set DUMP_PATH variable.'
20
+ pos_arg :dump_path
21
+ end
22
+
23
+ # @return [String]
24
+ def help_extra_text
25
+ "Default dump path: \"#{default_dump_path}\""
21
26
  end
22
27
 
23
28
  def run
@@ -47,7 +52,7 @@ module Avm
47
52
  end
48
53
 
49
54
  def default_dump_path
50
- instance.read_entry(DEFAULT_DUMP_PATH_ENTRY_SUFFIX)
55
+ instance.data_default_dump_path
51
56
  end
52
57
 
53
58
  def package_dump_existing
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/runner'
4
+ require 'eac_cli/core_ext'
5
+
6
+ module Avm
7
+ module Tools
8
+ class Runner
9
+ class Instance < ::Avm::Instances::Runner
10
+ class Data
11
+ class Load
12
+ runner_with :help do
13
+ desc 'Load utility for EacRailsBase instance.'
14
+ arg_opt '-S', '--source-instance', 'Informa a instância a ser extraída o dump.'
15
+ pos_arg :dump_path, optional: true
16
+ end
17
+
18
+ def run
19
+ return fatal_error("Dump \"#{dump_path}\" does not exist") unless
20
+ ::File.exist?(dump_path)
21
+
22
+ load_dump
23
+ success("Dump loaded from \"#{dump_path}\"")
24
+ end
25
+
26
+ def dump_path_uncached
27
+ return parsed.dump_path.to_s if parsed.dump_path.present?
28
+ return source_instance_dump_path if parsed.source_instance.present?
29
+
30
+ raise "Dump path unknown (Options: #{parsed})"
31
+ end
32
+
33
+ def source_instance_dump_path
34
+ runner_context.call(:instance).class.by_id(parsed.source_instance).run_subcommand(
35
+ ::Avm::Tools::Runner::Instance::Data::Dump, []
36
+ )
37
+ end
38
+
39
+ def load_dump
40
+ info "Loading dump \"#{dump_path}\"..."
41
+ package_load.run
42
+ end
43
+
44
+ def dump_instance_method
45
+ :dump_database
46
+ end
47
+
48
+ private
49
+
50
+ def package_load_uncached
51
+ runner_context.call(:instance).data_package.load(dump_path)
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/instances/runner'
3
4
  require 'eac_cli/core_ext'
4
5
 
5
6
  module Avm
6
- module EacWebappBase0
7
- module Instances
8
- module Runners
7
+ module Tools
8
+ class Runner
9
+ class Instance < ::Avm::Instances::Runner
9
10
  class Data
10
11
  class Unit
11
12
  class Clear
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/runner'
4
+ require 'eac_cli/core_ext'
5
+
6
+ module Avm
7
+ module Tools
8
+ class Runner
9
+ class Instance < ::Avm::Instances::Runner
10
+ class Data
11
+ class Unit
12
+ class Dump
13
+ runner_with :help do
14
+ pos_arg :dump_path, optional: true
15
+ end
16
+
17
+ def run
18
+ runner_context.call(:data_unit).dump(dump_path)
19
+ end
20
+
21
+ # @return [String]
22
+ def help_extra_text
23
+ "Default dump path: \"#{default_dump_path}\""
24
+ end
25
+
26
+ # @return [Pathname]
27
+ def dump_path
28
+ (parsed.dump_path || default_dump_path).to_pathname
29
+ end
30
+
31
+ # @return [String]
32
+ def default_dump_path
33
+ runner_context.call(:data_unit).data_default_dump_path
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/instances/runner'
3
4
  require 'eac_cli/core_ext'
4
5
 
5
6
  module Avm
6
- module EacWebappBase0
7
- module Instances
8
- module Runners
7
+ module Tools
8
+ class Runner
9
+ class Instance < ::Avm::Instances::Runner
9
10
  class Data
10
11
  class Unit
11
12
  require_sub __FILE__
@@ -29,9 +30,9 @@ module Avm
29
30
  data_package.unit(parsed.identifier)
30
31
  end
31
32
 
32
- # @return [Hash<String, Enumerable<String>]
33
+ # @return [String]
33
34
  def help_extra_text
34
- super.merge('Available units' => available_units_ids)
35
+ help_join_sections(super, list_section('Available units', available_units_ids))
35
36
  end
36
37
  end
37
38
  end
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/instances/runner'
3
4
  require 'eac_cli/core_ext'
4
5
 
5
6
  module Avm
6
- module EacWebappBase0
7
- module Instances
8
- module Runners
7
+ module Tools
8
+ class Runner
9
+ class Instance < ::Avm::Instances::Runner
9
10
  class Data
10
11
  require_sub __FILE__
11
12
  runner_with :help, :subcommands do
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.145.1'
5
+ VERSION = '0.146.0'
6
6
  end
7
7
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.add_dependency 'colorize', '~> 0.8', '>= 0.8.1'
16
16
  s.add_dependency 'eac_config', '~> 0.12'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.113'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.114'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
20
20
  end
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_cli/definition/default_value'
3
4
  require 'eac_ruby_utils/core_ext'
4
5
 
5
6
  module EacCli
6
7
  class Definition
7
8
  class BaseOption
8
9
  require_sub __FILE__
10
+ include ::EacCli::Definition::DefaultValue
9
11
 
10
12
  class << self
11
13
  def from_args(args)
@@ -17,7 +19,7 @@ module EacCli
17
19
  DEFAULT_REQUIRED = false
18
20
 
19
21
  enable_listable
20
- enable_abstract_methods :build_value, :default_value
22
+ enable_abstract_methods :build_value
21
23
  lists.add_symbol :option, :default, :optional, :usage, :repeat, :required
22
24
  common_constructor :short, :long, :description, :options, default: [{}] do
23
25
  raise 'Nor short neither long selector was set' if short.blank? && long.blank?