eac_tools 0.21.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +70 -70
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +6 -6
  5. data/sub/avm/lib/avm/instances/base.rb +1 -1
  6. data/sub/avm/lib/avm/instances/runner.rb +4 -2
  7. data/sub/avm/lib/avm/sources/base/application.rb +34 -0
  8. data/sub/avm/lib/avm/sources/base/configuration.rb +2 -0
  9. data/sub/avm/lib/avm/sources/base/testing.rb +1 -1
  10. data/sub/avm/lib/avm/version.rb +1 -1
  11. data/sub/avm/lib/avm/with/application_stereotype.rb +1 -3
  12. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +5 -5
  13. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb +13 -0
  14. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances.rb +11 -0
  15. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  16. data/sub/avm-eac_latex_base0/avm-eac_latex_base0.gemspec +3 -3
  17. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/base.rb +2 -2
  18. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/version.rb +1 -1
  19. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +2 -2
  20. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances/base.rb +13 -0
  21. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances.rb +11 -0
  22. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners/base.rb +1 -1
  23. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  24. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_host_spec.rb +2 -2
  25. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_path_spec.rb +2 -2
  26. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
  27. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +27 -0
  28. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances.rb +11 -0
  29. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +1 -1
  30. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +2 -2
  31. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  32. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +6 -6
  33. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +48 -4
  34. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances.rb +11 -0
  35. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb +1 -1
  36. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners.rb +11 -0
  37. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources.rb +11 -0
  38. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  39. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +3 -3
  40. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundler.rb +6 -0
  41. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/bundle_update.rb +23 -0
  42. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/update_dependencies_requirements.rb +1 -1
  43. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +2 -4
  44. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update_dependency_requirements.rb +7 -0
  45. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  46. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec.rb +8 -1
  47. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec_files/dashed-mygem/Gemfile.lock +1 -0
  48. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec_files/dashed-mygem/_gitignore +2 -0
  49. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec_files/mygem/Gemfile.lock +1 -0
  50. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec_files/mygem/_gitignore +2 -0
  51. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +4 -4
  52. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb +26 -0
  53. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +61 -0
  54. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/dump.rb +65 -0
  55. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +57 -0
  56. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data.rb +19 -0
  57. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners.rb +13 -0
  58. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  59. data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +3 -3
  60. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/base.rb +2 -2
  61. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
  62. data/sub/avm-tools/avm-tools.gemspec +11 -11
  63. data/sub/avm-tools/lib/avm/tools/runner/app_src/info.rb +10 -8
  64. data/sub/avm-tools/lib/avm/tools/runner/instance.rb +3 -1
  65. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  66. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +9 -1
  67. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +5 -0
  68. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +17 -2
  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/listable_spec.rb +32 -82
  71. metadata +49 -49
  72. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instance.rb +0 -11
  73. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instance.rb +0 -11
  74. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -25
  75. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instance.rb +0 -57
  76. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +0 -24
  77. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +0 -62
  78. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +0 -63
  79. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +0 -55
  80. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +0 -17
@@ -12,14 +12,14 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.29'
16
- s.add_dependency 'avm-eac_generic_base0', '~> 0.4'
17
- s.add_dependency 'avm-eac_rails_base1', '~> 0.4', '>= 0.4.1'
15
+ s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
16
+ s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
17
+ s.add_dependency 'avm-eac_rails_base1', '~> 0.5'
18
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
- s.add_dependency 'curb', '~> 0.9.11'
20
- s.add_dependency 'eac_fs', '~> 0.12', '>= 0.12.2'
19
+ s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
20
+ s.add_dependency 'eac_fs', '~> 0.12', '>= 0.12.3'
21
21
  s.add_dependency 'eac_rest', '~> 0.6', '>= 0.6.1'
22
- s.add_dependency 'eac_ruby_utils', '~> 0.95', '>= 0.95.2'
22
+ s.add_dependency 'eac_ruby_utils', '~> 0.98'
23
23
 
24
24
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
25
25
  end
@@ -1,13 +1,57 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/base'
4
- require 'avm/eac_redmine_base0/instances/runners'
5
- require 'eac_ruby_utils/core_ext'
3
+ require 'addressable/uri'
4
+ require 'avm/eac_redmine_base0/data_unit'
5
+ require 'avm/eac_redmine_base0/instances/docker_image'
6
+ require 'avm/eac_redmine_base0/rest_api'
7
+ require 'avm/eac_rails_base1/instances/base'
6
8
 
7
9
  module Avm
8
10
  module EacRedmineBase0
9
11
  module Instances
10
- class Base < ::Avm::Instances::Base
12
+ class Base < ::Avm::EacRailsBase1::Instances::Base
13
+ enable_simple_cache
14
+
15
+ FILES_UNITS = { files: 'files' }.freeze
16
+
17
+ def docker_image_class
18
+ ::Avm::EacRedmineBase0::Instances::DockerImage
19
+ end
20
+
21
+ def docker_run_arguments
22
+ [
23
+ '--volume',
24
+ "#{read_entry(::Avm::Instances::EntryKeys::FS_PATH)}:/home/myuser/eac_redmine_base0",
25
+ '--publish', "#{read_entry(:ssh_port)}:22",
26
+ '--publish', "#{read_entry(:http_port)}:80",
27
+ '--publish', "#{read_entry(:https_port)}:443"
28
+ ]
29
+ end
30
+
31
+ def data_package
32
+ @data_package ||= ::Avm::Data::Instance::Package.new(
33
+ self,
34
+ units: {
35
+ all: ::Avm::EacRedmineBase0::DataUnit.new(self)
36
+ }
37
+ )
38
+ end
39
+
40
+ # @return [Addressable::URI]
41
+ def root_url
42
+ r = ::Addressable::URI.parse(read_entry(::Avm::Instances::EntryKeys::WEB_URL))
43
+ r.query_values = nil
44
+ r
45
+ end
46
+
47
+ private
48
+
49
+ # @return [Avm::EacRedmineBase0::RestApi]
50
+ def rest_api_uncached
51
+ url = root_url
52
+ url.query_values = { key: read_entry('api.key') }
53
+ ::Avm::EacRedmineBase0::RestApi.new(url)
54
+ end
11
55
  end
12
56
  end
13
57
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Instances
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_redmine_base0/instance'
3
+ require 'avm/eac_redmine_base0/instances/base'
4
4
  require 'avm/eac_redmine_base0/deploy'
5
5
  require 'avm/eac_redmine_base0/apache_host'
6
6
  require 'avm/eac_rails_base1/runner'
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Runners
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Sources
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRedmineBase0
5
- VERSION = '0.11.0'
5
+ VERSION = '0.12.0'
6
6
  end
7
7
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.34'
16
- s.add_dependency 'avm-eac_generic_base0', '~> 0.2'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.95', '>= 0.95.1'
15
+ s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
16
+ s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.98'
18
18
 
19
19
  s.add_development_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
20
20
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'avm/eac_generic_base0/sources/base'
4
4
  require 'avm/eac_ruby_base1/sources/base/bundle_command'
5
+ require 'avm/eac_ruby_base1/sources/bundle_update'
5
6
  require 'eac_ruby_utils/core_ext'
6
7
 
7
8
  module Avm
@@ -18,6 +19,11 @@ module Avm
18
19
  .envvar_gemfile
19
20
  end
20
21
 
22
+ # @return [Avm::EacRubyBase1::Sources::BundleUpdate]
23
+ def bundle_update
24
+ ::Avm::EacRubyBase1::Sources::BundleUpdate.new(self)
25
+ end
26
+
21
27
  # @return [String]
22
28
  def configured_gemfile_path
23
29
  configuration_entry(CONFIGURED_GEMFILE_PATH_ENTRY_KEY).value
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Sources
8
+ class BundleUpdate
9
+ common_constructor :source
10
+ delegate :bundle, to: :source
11
+
12
+ def execute!
13
+ bundle('update').execute! + bundle('install').execute!
14
+ end
15
+
16
+ def system!
17
+ bundle('update').system!
18
+ bundle('install').system!
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -9,7 +9,7 @@ module Avm
9
9
  module Sources
10
10
  module Runners
11
11
  class UpdateDependenciesRequirements
12
- runner_with :help, :subcommands do
12
+ runner_with :help do
13
13
  bool_opt '-a', '--all'
14
14
  pos_arg :gem_name, repeat: true, optional: true
15
15
  end
@@ -14,10 +14,8 @@ module Avm
14
14
  end
15
15
 
16
16
  def bundle_update
17
- infom 'Running "bundle update"...'
18
- source.bundle('update').execute!
19
- infom 'Running "bundle install"...'
20
- source.bundle('install').execute!
17
+ infom 'Running "bundle update && bundle install"...'
18
+ source.bundle_update.execute!
21
19
  end
22
20
 
23
21
  protected
@@ -35,9 +35,16 @@ module Avm
35
35
  ::Avm::EacRubyBase1::Rubygems::Gemspec.from_file(source.gemspec_path)
36
36
  end
37
37
 
38
+ def parent_bundle
39
+ return unless source.parent.if_present { |v| v.is_a?(::Avm::EacRubyBase1::Sources::Base) }
40
+
41
+ source.parent.bundle_update.execute!
42
+ end
43
+
38
44
  def update_code
39
45
  update_gemspec
40
46
  source.bundle.system!
47
+ parent_bundle
41
48
  end
42
49
 
43
50
  def update_gemspec
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.18.0'
5
+ VERSION = '0.19.1'
6
6
  end
7
7
  end
@@ -33,10 +33,17 @@ RSpec.describe ::Avm::EacRubyBase1::SourceGenerators::Base do
33
33
 
34
34
  def directory_to_h(dir)
35
35
  dir.children.map do |child|
36
- [child.basename.to_path, fs_object_to_h(child)]
36
+ [fs_object_basename(child), fs_object_to_h(child)]
37
37
  end.to_h
38
38
  end
39
39
 
40
+ # @return [String]
41
+ def fs_object_basename(obj)
42
+ r = obj.basename.to_path
43
+ r = '.gitignore' if r == '_gitignore'
44
+ r
45
+ end
46
+
40
47
  def fs_object_to_h(obj)
41
48
  if obj.file?
42
49
  file_to_h(obj)
@@ -0,0 +1 @@
1
+ Is expected that this content be replaced by "TRUNCATED\n".
@@ -0,0 +1 @@
1
+ Is expected that this content be replaced by "TRUNCATED\n".
@@ -12,11 +12,11 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.1'
16
- s.add_dependency 'avm-eac_generic_base0', '~> 0.1'
17
- s.add_dependency 'avm-eac_postgresql_base0', '~> 0.1'
15
+ s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
16
+ s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
17
+ s.add_dependency 'avm-eac_postgresql_base0', '~> 0.2'
18
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
- s.add_dependency 'eac_ruby_utils', '~> 0.68'
19
+ s.add_dependency 'eac_ruby_utils', '~> 0.98'
20
20
 
21
21
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
22
22
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacWebappBase0
7
+ module Instances
8
+ class Base < ::Avm::Instances::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
26
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/base'
4
+ require 'avm/eac_postgresql_base0/instance_with'
5
+ require 'avm/data/instance/files_unit'
6
+ require 'avm/data/instance/package'
7
+ require 'avm/eac_webapp_base0/deploy/file_unit'
8
+ require 'avm/eac_webapp_base0/instances/runners'
9
+ require 'avm/eac_ubuntu_base0/instances/base'
10
+
11
+ module Avm
12
+ module EacWebappBase0
13
+ module Instances
14
+ class Base < ::Avm::Instances::Base
15
+ require_sub __FILE__
16
+ include ::Avm::EacPostgresqlBase0::InstanceWith
17
+ enable_simple_cache
18
+
19
+ FILES_UNITS = [].freeze
20
+
21
+ def data_dump(argv = [])
22
+ run_subcommand(data_dump_runner_class, argv)
23
+ end
24
+
25
+ def data_dump_runner_class
26
+ "#{stereotype_namespace_module}::Runner::Data::Dump".constantize
27
+ end
28
+
29
+ def run_subcommand(subcommand_class, argv)
30
+ subcommand_class.create(
31
+ argv: argv,
32
+ parent: ::Avm::EacWebappBase0::Instance::SubcommandParent.new(self)
33
+ ).run
34
+ end
35
+
36
+ def data_package
37
+ @data_package ||= ::Avm::Data::Instance::Package.new(
38
+ self, units: { database: database_unit }.merge(files_units)
39
+ )
40
+ end
41
+
42
+ def database_unit
43
+ pg.data_unit
44
+ end
45
+
46
+ private
47
+
48
+ # @return [Avm::EacUbuntuBase0::Instances::Base]
49
+ def platform_instance_uncached
50
+ ::Avm::EacUbuntuBase0::Instances::Base.by_id(id)
51
+ end
52
+
53
+ def files_units
54
+ self.class.const_get('FILES_UNITS').transform_values do |fs_path_subpath|
55
+ ::Avm::Data::Instance::FilesUnit.new(self, fs_path_subpath)
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/data/package/dump'
4
+ require 'eac_cli/core_ext'
5
+
6
+ module Avm
7
+ module EacWebappBase0
8
+ module Instances
9
+ module Runners
10
+ class Data
11
+ class Dump
12
+ DUMP_EXPIRE_TIME = 1.day
13
+ DEFAULT_DUMP_PATH_ENTRY_SUFFIX = 'data.default_dump_path'
14
+ NO_DUMP_MESSAGE = 'Dump "%s" already exist and rewrite options was no setted nor ' \
15
+ 'dump was expired.'
16
+
17
+ runner_with :help do
18
+ desc 'Dump utility for EacRailsBase instance.'
19
+ bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
20
+ arg_opt '-p', '--dump-path', 'Set DUMP_PATH variable.'
21
+ end
22
+
23
+ def run
24
+ infov 'Instance to dump', "#{instance} (#{instance.class})"
25
+ if package_dump.runnable?
26
+ package_dump.run
27
+ else
28
+ warn(package_dump.cannot_run_reason)
29
+ end
30
+ success("Dump path: \"#{dump_path}\"")
31
+ dump_path
32
+ end
33
+
34
+ private
35
+
36
+ def instance
37
+ runner_context.call(:instance)
38
+ end
39
+
40
+ def package_dump_uncached
41
+ instance
42
+ .data_package.dump(dump_path, existing: package_dump_existing)
43
+ end
44
+
45
+ def dump_path
46
+ parsed.dump_path || default_dump_path
47
+ end
48
+
49
+ def default_dump_path
50
+ instance.read_entry(DEFAULT_DUMP_PATH_ENTRY_SUFFIX)
51
+ end
52
+
53
+ def package_dump_existing
54
+ if parsed.rewrite?
55
+ ::Avm::Data::Package::Dump::EXISTING_ROTATE
56
+ else
57
+ ::Avm::Data::Package::Dump::EXISTING_ROTATE_EXPIRED
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/numeric/time'
4
+ require 'eac_cli/speaker'
5
+ require 'eac_ruby_utils/simple_cache'
6
+
7
+ module Avm
8
+ module EacWebappBase0
9
+ module Instances
10
+ module Runners
11
+ class Data
12
+ class Load
13
+ runner_with :help do
14
+ desc 'Load utility for EacRailsBase instance.'
15
+ arg_opt '-S', '--source-instance', 'Informa a instância a ser extraída o dump.'
16
+ pos_arg :dump_path, optional: true
17
+ end
18
+
19
+ def run
20
+ return ::Dev::Result.error("Dump \"#{dump_path}\" does not exist") unless
21
+ ::File.exist?(dump_path)
22
+
23
+ load_dump
24
+ success("Dump loaded from \"#{dump_path}\"")
25
+ end
26
+
27
+ def dump_path_uncached
28
+ return parsed.dump_path.to_s if parsed.dump_path.present?
29
+ return source_instance_dump_path if parsed.source_instance.present?
30
+
31
+ raise "Dump path unknown (Options: #{parsed})"
32
+ end
33
+
34
+ def source_instance_dump_path
35
+ runner_context.call(:instance).class.by_id(parsed.source_instance).data_dump
36
+ end
37
+
38
+ def load_dump
39
+ info "Loading dump \"#{dump_path}\"..."
40
+ package_load.run
41
+ end
42
+
43
+ def dump_instance_method
44
+ :dump_database
45
+ end
46
+
47
+ private
48
+
49
+ def package_load_uncached
50
+ runner_context.call(:instance).data_package.load(dump_path)
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacWebappBase0
7
+ module Instances
8
+ module Runners
9
+ class Data
10
+ require_sub __FILE__
11
+ runner_with :help, :subcommands do
12
+ desc 'Data utilities for EacRailsBase0 instances.'
13
+ subcommands
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacWebappBase0
7
+ module Instances
8
+ module Runners
9
+ require_sub __FILE__
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWebappBase0
5
- VERSION = '0.3.1'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.35'
16
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.3', '>= 0.3.1'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.97'
15
+ s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
16
+ s.add_dependency 'avm-eac_webapp_base0', '~> 0.4'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.98'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5', '>= 0.5.1'
20
20
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/instances/entry_keys'
4
- require 'avm/eac_webapp_base0/instance'
4
+ require 'avm/eac_webapp_base0/instances/base'
5
5
 
6
6
  module Avm
7
7
  module EacWordpressBase0
8
8
  module Instances
9
- class Base < ::Avm::EacWebappBase0::Instance
9
+ class Base < ::Avm::EacWebappBase0::Instances::Base
10
10
  FILES_UNITS = { uploads: 'wp-content/uploads', themes: 'wp-content/themes' }.freeze
11
11
 
12
12
  def database_unit
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWordpressBase0
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
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.4'
18
- s.add_dependency 'avm', '~> 0.34'
19
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.8'
17
+ s.add_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
18
+ s.add_dependency 'avm', '~> 0.37'
19
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.19', '>= 0.19.1'
20
20
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
21
- s.add_dependency 'avm-files', '~> 0.1'
22
- s.add_dependency 'avm-git', '~> 0.3', '>= 0.3.1'
23
- s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.3'
24
- s.add_dependency 'curb', '~> 0.9.10'
25
- s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.1'
26
- s.add_dependency 'eac_ruby_base0', '~> 0.16', '>= 0.16.4'
21
+ s.add_dependency 'avm-files', '~> 0.3', '>= 0.3.2'
22
+ s.add_dependency 'avm-git', '~> 0.4'
23
+ s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.6'
24
+ s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
25
+ s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.2'
26
+ s.add_dependency 'eac_ruby_base0', '~> 0.16', '>= 0.16.6'
27
27
  s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.1'
28
- s.add_dependency 'git', '~> 1.7'
29
- s.add_dependency 'ruby-progressbar', '~> 1.10', '>= 1.10.1'
28
+ s.add_dependency 'git', '~> 1.11'
29
+ s.add_dependency 'ruby-progressbar', '~> 1.11'
30
30
 
31
31
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
32
32
  end