eac_tools 0.63.0 → 0.65.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) 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/data/package.rb +1 -1
  6. data/sub/avm/lib/avm/data/unit.rb +25 -54
  7. data/sub/avm/lib/avm/data/unit_with_commands.rb +52 -0
  8. data/sub/avm/lib/avm/instances/base/subcommand_parent.rb +25 -0
  9. data/sub/avm/lib/avm/instances/data/files_unit.rb +1 -4
  10. data/sub/avm/lib/avm/instances/data/unit.rb +14 -2
  11. data/sub/avm/lib/avm/instances/entry_keys.rb +1 -0
  12. data/sub/avm/lib/avm/version.rb +1 -1
  13. data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +2 -2
  14. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +5 -8
  15. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb +0 -4
  16. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb +5 -0
  17. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +1 -1
  18. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +3 -3
  19. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +2 -10
  20. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +3 -1
  21. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  22. data/sub/avm-tools/avm-tools.gemspec +11 -11
  23. 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
  24. data/sub/avm-tools/lib/avm/tools/runner/instance/data/load.rb +58 -0
  25. 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
  26. data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/dump.rb +41 -0
  27. data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/unit/load.rb +10 -4
  28. 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
  29. data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data.rb +4 -3
  30. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  31. data/sub/eac_cli/eac_cli.gemspec +1 -1
  32. data/sub/eac_cli/lib/eac_cli/definition/base_option.rb +3 -1
  33. data/sub/eac_cli/lib/eac_cli/definition/default_value.rb +17 -0
  34. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +8 -26
  35. data/sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb +40 -0
  36. data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +12 -0
  37. data/sub/eac_cli/lib/eac_cli/runner_with/input.rb +1 -1
  38. data/sub/eac_cli/lib/eac_cli/runner_with/output.rb +1 -1
  39. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +1 -4
  40. data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
  41. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb +21 -0
  42. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +0 -1
  43. data/sub/eac_ruby_utils/lib/eac_ruby_utils/{abstract_methods.rb → acts_as_abstract.rb} +30 -9
  44. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/abstract.rb +2 -2
  45. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +3 -3
  46. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_abstract.rb +14 -0
  47. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +5 -1
  48. data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +2 -2
  49. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  50. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{abstract_methods_spec.rb → acts_as_abstract_spec.rb} +2 -2
  51. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/abstract_spec.rb +1 -1
  52. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/acts_as_abstract_spec.rb +14 -0
  53. metadata +34 -29
  54. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb +0 -26
  55. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/unit/dump.rb +0 -25
  56. data/sub/eac_cli/lib/eac_cli/runner_with/help/list_section.rb +0 -22
  57. 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: 47a797b3de79a663eae4d7dc4c3cdc600756b13f53386dbcd88fb4732b195eeb
4
+ data.tar.gz: 263a4b784e9cb99e1a9c023efdd2f048d4b83dfb73247300f6fe92db97c76dd7
5
5
  SHA512:
6
- metadata.gz: a89a40d5ceefd62730be561a0bf3305bfacdcdf71ad65c77fbb9e2d04f6e31592e12a54efc2dfcac24f0a39bdd0fdeda2d8a94200c0fd9b8141f45a47b2b3469
7
- data.tar.gz: 8e2546581a3d82e9d3d984894e35cc40941364e338c39433e9bfd9cb169222b9f3277042523293ea04e4aa87401d8b4b32f039552c03a101e29e33f61c0f6f0e
6
+ metadata.gz: ad1076587dc04620251e5a391e0c169467aaaae2db7c725589322abad1f84c2c14e53056f07db414549e80864b3775e18105d1c3a25a7e2db2fb6c3adcaa97c8
7
+ data.tar.gz: f38150d6c56ceb13ff86d8c921fa6867a3cb65e4f36050f2fcf790558832f0b4d1641f7fefdc125a276b1cab512538668b8d30396ff5c0bf50cfc5cb0c43c3bc
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.65.0)
5
+ avm (~> 0.71)
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, >= 0.5.1)
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.147)
21
+ eac_ruby_utils (~> 0.115)
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.1)
71
+ avm (~> 0.71)
72
+ eac_ruby_utils (~> 0.115)
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.147.0)
177
+ aranha-parsers (~> 0.17, >= 0.17.1)
178
+ avm (~> 0.71)
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.71.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.115)
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.115.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.65.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.115'
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'
@@ -46,7 +46,7 @@ module Avm
46
46
  end
47
47
 
48
48
  # @param id [Symbol]
49
- # @return [Avm::Data::Unit]
49
+ # @return [Avm::Data::UnitWithCommands]
50
50
  def unit(identifier)
51
51
  units[identifier.to_sym] || raise("No unit found with identifier \"#{identifier}\"")
52
52
  end
@@ -6,72 +6,43 @@ require 'eac_ruby_utils/core_ext'
6
6
  module Avm
7
7
  module Data
8
8
  class Unit
9
- include ::Avm::Data::Callbacks
10
-
9
+ acts_as_abstract(
10
+ do_clear: [],
11
+ do_dump: [:dump_path],
12
+ do_load: [:dump_path],
13
+ dump_path_extension: []
14
+ )
11
15
  enable_speaker
16
+ include ::Avm::Data::Callbacks
12
17
 
13
- %w[dump load].each do |action|
14
- method_name = "#{action}_command"
15
- class_eval <<~CODE, __FILE__, __LINE__ + 1
16
- # Should be overrided.
17
- # @return [EacRubyUtils::Envs::Command]
18
- def #{method_name}
19
- fail "\\"#{method_name}\\" is a abstract method. Override in #{singleton_class}."
20
- end
21
- CODE
22
- end
23
-
24
- def extension
25
- singleton_class.const_get('EXTENSION')
26
- rescue NameError
27
- ''
28
- end
29
-
30
- def name
31
- self.class
32
- end
33
-
34
- def load_from_directory(directory, identifier)
35
- load(unit_on_directory_path(directory, identifier))
36
- end
37
-
38
- def dump_to_directory(directory, identifier)
39
- dump(unit_on_directory_path(directory, identifier))
18
+ # @param dump_path [Pathname]
19
+ # @return [void]
20
+ def clear
21
+ run_callbacks(:dump) { do_clear }
40
22
  end
41
23
 
42
- def dump(data_path)
24
+ # @param dump_path [Pathname]
25
+ # @return [void]
26
+ def dump(dump_path)
43
27
  run_callbacks :dump do
44
- infom "Dumping unit \"#{name}\" to \"#{data_path}\"..."
45
- do_dump(data_path)
28
+ infom "Dumping unit \"#{name}\" to \"#{dump_path}\"..."
29
+ do_dump(dump_path)
46
30
  end
47
31
  end
48
32
 
49
- # @return [Struct(:key, :subpath), nil]
50
- def installation_files_data
51
- nil
52
- end
53
-
54
- def load(data_path)
33
+ # @param dump_path [Pathname]
34
+ # @return [void]
35
+ def load(dump_path)
55
36
  run_callbacks :load do
56
- infom "Loading unit \"#{name}\" from \"#{data_path}\"..."
57
- do_load(data_path)
37
+ clear
38
+ infom "Loading unit \"#{name}\" from \"#{dump_path}\"..."
39
+ do_load(dump_path)
58
40
  end
59
41
  end
60
42
 
61
- protected
62
-
63
- def do_dump(data_path)
64
- dump_command.execute!(output_file: data_path)
65
- end
66
-
67
- def do_load(data_path)
68
- load_command.execute!(input_file: data_path)
69
- end
70
-
71
- private
72
-
73
- def unit_on_directory_path(directory, identifier)
74
- ::File.join(directory, "#{identifier}#{extension}")
43
+ # @return [String]
44
+ def name
45
+ self.class.name
75
46
  end
76
47
  end
77
48
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/data/callbacks'
4
+ require 'avm/data/unit'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module Data
9
+ class UnitWithCommands < ::Avm::Data::Unit
10
+ acts_as_abstract
11
+
12
+ abstract_method :dump_command
13
+ abstract_method :load_command
14
+
15
+ # @return [String]
16
+ def dump_path_extension
17
+ singleton_class.const_get('EXTENSION')
18
+ rescue NameError
19
+ ''
20
+ end
21
+
22
+ def load_from_directory(directory, identifier)
23
+ load(unit_on_directory_path(directory, identifier))
24
+ end
25
+
26
+ def dump_to_directory(directory, identifier)
27
+ dump(unit_on_directory_path(directory, identifier))
28
+ end
29
+
30
+ # @return [Struct(:key, :subpath), nil]
31
+ def installation_files_data
32
+ nil
33
+ end
34
+
35
+ protected
36
+
37
+ def do_dump(data_path)
38
+ dump_command.execute!(output_file: data_path)
39
+ end
40
+
41
+ def do_load(data_path)
42
+ load_command.execute!(input_file: data_path)
43
+ end
44
+
45
+ private
46
+
47
+ def unit_on_directory_path(directory, identifier)
48
+ ::File.join(directory, "#{identifier}#{dump_path_extension}")
49
+ end
50
+ end
51
+ end
52
+ end
@@ -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
@@ -17,8 +17,6 @@ module Avm
17
17
  self.options = self.class.lists.option.hash_keys_validate!(options)
18
18
  end
19
19
 
20
- before_load :clear
21
-
22
20
  # @return [Pathname]
23
21
  def files_path
24
22
  fs_path_subpath
@@ -33,8 +31,7 @@ module Avm
33
31
  instance_command('tar', '-xzf', '-', '-C', files_path)
34
32
  end
35
33
 
36
- def clear
37
- infom "Removing all files under #{files_path}..."
34
+ def do_clear
38
35
  instance_command('mkdir', '-p', files_path).execute!
39
36
  instance_command('find', files_path, '-mindepth', 1, '-delete').execute!
40
37
  end
@@ -1,13 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/data/unit'
3
+ require 'avm/data/unit_with_commands'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
 
6
6
  module Avm
7
7
  module Instances
8
8
  module Data
9
- class Unit < ::Avm::Data::Unit
9
+ class Unit < ::Avm::Data::UnitWithCommands
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}#{dump_path_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.71.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.71'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.115'
17
17
 
18
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -12,10 +12,7 @@ module Avm
12
12
  TABLES_SQL = "select schemaname || '#{TABLE_PARTS_SEPARATOR}' || tablename from " \
13
13
  "pg_tables where schemaname = '#{SCHEMA_VAR}'"
14
14
 
15
- before_load :clear
16
-
17
- def clear
18
- info 'Clearing database (Dropping all tables)...'
15
+ def do_clear
19
16
  ts = tables
20
17
  if ts.empty?
21
18
  info 'Database has no tables'
@@ -26,11 +23,11 @@ module Avm
26
23
  end
27
24
 
28
25
  def dump_command
29
- instance.dump_gzip_command
26
+ instance.pg.dump_gzip_command
30
27
  end
31
28
 
32
29
  def load_command
33
- instance.load_gzip_command
30
+ instance.pg.load_gzip_command
34
31
  end
35
32
 
36
33
  private
@@ -49,7 +46,7 @@ module Avm
49
46
  end
50
47
 
51
48
  def run_sql(sql)
52
- instance.psql_command_command(sql).execute!
49
+ instance.pg.psql_command_command(sql).execute!
53
50
  end
54
51
 
55
52
  # @return [Array<String>]
@@ -60,7 +57,7 @@ module Avm
60
57
 
61
58
  # @return [String]
62
59
  def tables_sql
63
- TABLES_SQL.gsub(SCHEMA_VAR, instance.schema)
60
+ TABLES_SQL.gsub(SCHEMA_VAR, instance.pg.schema)
64
61
  end
65
62
  end
66
63
  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.1'
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.71'
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