avm-tools 0.106.0 → 0.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/instances/entry.rb +3 -3
  3. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +2 -2
  4. data/lib/avm/ruby/rubocop/_configured.rb +2 -2
  5. data/lib/avm/tools/app_src.rb +68 -0
  6. data/lib/avm/tools/runner/app_src/info.rb +16 -2
  7. data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +2 -4
  8. data/lib/avm/tools/runner/app_src.rb +2 -2
  9. data/lib/avm/tools/runner/config/load_path.rb +2 -2
  10. data/lib/avm/tools/runner/git/deploy.rb +2 -2
  11. data/lib/avm/tools/runner.rb +1 -1
  12. data/lib/avm/tools/version.rb +1 -1
  13. data/vendor/avm/avm.gemspec +3 -0
  14. data/vendor/avm/lib/avm/app_src/base.rb +45 -0
  15. data/vendor/avm/lib/avm/app_src/configuration/_locale.rb +16 -0
  16. data/vendor/avm/lib/avm/app_src/configuration/_rubocop.rb +24 -0
  17. data/vendor/avm/lib/avm/app_src/configuration/_tests.rb +27 -0
  18. data/vendor/avm/lib/avm/app_src/configuration.rb +55 -0
  19. data/vendor/avm/lib/avm/app_src.rb +9 -0
  20. data/vendor/avm/lib/avm/files/formatter/formats/base.rb +2 -2
  21. data/vendor/avm/lib/avm/files/formatter/formats/javascript.rb +1 -0
  22. data/vendor/avm/lib/avm/files/formatter/formats/php.rb +1 -0
  23. data/vendor/avm/lib/avm/files/formatter/formats/python.rb +1 -0
  24. data/vendor/avm/lib/avm/files/formatter/formats/xml.rb +1 -0
  25. data/vendor/avm/lib/avm/files/formatter/utf8_assert.rb +2 -2
  26. data/vendor/avm/lib/avm/git/issue/complete/test.rb +2 -2
  27. data/vendor/avm/lib/avm/git/revision_test.rb +2 -3
  28. data/vendor/avm/lib/avm/jobs/base.rb +62 -0
  29. data/vendor/avm/lib/avm/jobs/variables_source.rb +22 -0
  30. data/vendor/{avm-apps/lib/avm/apps → avm/lib/avm}/jobs.rb +2 -4
  31. data/vendor/avm/lib/avm/version.rb +1 -1
  32. data/vendor/avm-apps/avm-apps.gemspec +1 -1
  33. data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
  34. data/vendor/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -0
  35. data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -2
  36. data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  37. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +2 -2
  38. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +2 -2
  39. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +2 -2
  40. data/vendor/eac_fs/Gemfile +5 -0
  41. data/vendor/eac_fs/eac_fs.gemspec +20 -0
  42. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb → eac_fs/lib/eac_fs/cache.rb} +7 -2
  43. data/{lib/avm → vendor/eac_fs/lib/eac_fs}/cached_download.rb +4 -4
  44. data/vendor/eac_fs/lib/eac_fs/file_info.rb +29 -0
  45. data/vendor/eac_fs/lib/eac_fs/patches/module/fs_cache.rb +10 -0
  46. data/vendor/eac_fs/lib/eac_fs/patches/module.rb +4 -0
  47. data/vendor/eac_fs/lib/eac_fs/patches/object/fs_cache.rb +10 -0
  48. data/vendor/eac_fs/lib/eac_fs/patches/object.rb +4 -0
  49. data/vendor/eac_fs/lib/eac_fs/patches/pathname/info.rb +12 -0
  50. data/vendor/eac_fs/lib/eac_fs/patches/pathname.rb +4 -0
  51. data/vendor/eac_fs/lib/eac_fs/patches.rb +4 -0
  52. data/vendor/eac_fs/lib/eac_fs/version.rb +5 -0
  53. data/vendor/eac_fs/lib/eac_fs.rb +7 -0
  54. data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb → eac_fs/spec/lib/eac_fs/cache_spec.rb} +2 -2
  55. data/vendor/eac_fs/spec/rubocop_spec.rb +3 -0
  56. data/vendor/eac_fs/spec/spec_helper.rb +4 -0
  57. data/vendor/eac_git/lib/eac_git/local/commit/archive.rb +1 -1
  58. data/vendor/eac_git/lib/eac_git/local/commit.rb +3 -3
  59. data/vendor/eac_git/lib/eac_git/local.rb +13 -0
  60. data/vendor/eac_git/lib/eac_git/version.rb +1 -1
  61. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +2 -1
  62. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +3 -3
  63. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +1 -0
  64. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +16 -7
  65. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  66. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -5
  67. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  68. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  69. data/vendor/eac_templates/lib/eac_templates/patches/module/erb_template.rb +9 -0
  70. data/vendor/eac_templates/lib/eac_templates/patches/module.rb +4 -0
  71. data/vendor/eac_templates/lib/eac_templates/patches/object/erb_template.rb +9 -0
  72. data/vendor/eac_templates/lib/eac_templates/patches/object.rb +4 -0
  73. data/vendor/eac_templates/lib/eac_templates/patches.rb +4 -0
  74. data/vendor/eac_templates/lib/eac_templates/version.rb +1 -1
  75. metadata +43 -178
  76. data/lib/avm/app_src.rb +0 -61
  77. data/lib/avm/fs_cache.rb +0 -11
  78. data/vendor/avm/lib/avm/files/info.rb +0 -24
  79. data/vendor/avm-apps/lib/avm/apps/config.rb +0 -19
  80. data/vendor/avm-apps/lib/avm/apps/jobs/base.rb +0 -64
  81. data/vendor/avm-apps/lib/avm/apps/jobs/variables_source.rb +0 -24
  82. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +0 -18
  83. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +0 -26
  84. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +0 -29
  85. data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +0 -57
  86. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a71fc17b60e581ba891e58d0b47ad9b4dbae79c2085540bb1816e02011e9af9
4
- data.tar.gz: 15387681892ce7192edd15b0e68ee801ed0fca233454b802df21f7d5e0a211a4
3
+ metadata.gz: 982669127ef20f0cf64fa12fbe0d087c0479b0e8575d7bb2c6047abac2ec81d3
4
+ data.tar.gz: d4d659206696045d925dbba86c5d4fa69e184dbbdc58001e3453344ef68ef9ef
5
5
  SHA512:
6
- metadata.gz: d61dadda2108d0d2b7a37f9ec55bbcbc73e222c87f463feec8b91d8f486b3869f1652849296a9bcb7c33e58fe65f1a99f5d12fe7e71c2b1fcf58231b2f453124
7
- data.tar.gz: 13a712ee6f75e13797fcf5107ad9b0c72f730195d4264e36ea5368635205aa68c55deb88c8055f01381342cefe48bf74d0decba9d6fe5052df6c6571622a1daf
6
+ metadata.gz: 436eb2a8f5957c9ffcb130851bb2dee4ab070cfd610a25356e8030766b6190a2a096b7a25250ab33801036f01e79e5c50bfc8024c2b6172f721f1868811251ea
7
+ data.tar.gz: 57711beda558d8e28ba2f98fd9ccbe4be8372e32093e1e45591ad7b5bb89cc9014946720b5430eaf66ef5ce4e583d96e3b3e556be39ce2670df577ee11d681cb
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/config'
3
+ require 'eac_config/node'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
 
6
6
  module Avm
@@ -31,7 +31,7 @@ module Avm
31
31
  end
32
32
 
33
33
  def read(extra_options = {})
34
- ::Avm::Apps::Config.current.entry(full_path, options.merge(extra_options)).value
34
+ ::EacConfig::Node.context.current.entry(full_path, options.merge(extra_options)).value
35
35
  end
36
36
 
37
37
  def suffix_as_array
@@ -47,7 +47,7 @@ module Avm
47
47
  end
48
48
 
49
49
  def write(value)
50
- ::Avm::Apps::Config.current.entry(full_path).value = value
50
+ ::EacConfig::Node.context.current.entry(full_path).value = value
51
51
  end
52
52
  end
53
53
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/sources/configuration'
3
+ require 'avm/app_src/configuration'
4
4
  require 'eac_ruby_gems_utils/gem'
5
5
  require 'eac_ruby_utils/core_ext'
6
6
 
@@ -13,7 +13,7 @@ module Avm
13
13
  private
14
14
 
15
15
  def configuration_uncached
16
- ::Avm::Apps::Sources::Configuration.find_in_path(root)
16
+ ::Avm::AppSrc::Configuration.find_in_path(root)
17
17
  end
18
18
 
19
19
  def gemfile_path_uncached
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/sources/configuration'
3
+ require 'avm/app_src/configuration'
4
4
 
5
5
  module Avm
6
6
  module Ruby
@@ -22,7 +22,7 @@ module Avm
22
22
  private
23
23
 
24
24
  def configuration_uncached
25
- ::Avm::Apps::Sources::Configuration.find_by_path(base_path)
25
+ ::Avm::AppSrc::Configuration.find_by_path(base_path)
26
26
  end
27
27
  end
28
28
  end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/app_src/base'
4
+ require 'avm/app_src/configuration'
5
+ require 'avm/launcher/paths/real'
6
+ require 'avm/projects/stereotype/job_comparator'
7
+ require 'eac_ruby_utils/core_ext'
8
+ require 'avm/projects/stereotypes'
9
+ require 'i18n'
10
+
11
+ module Avm
12
+ module Tools
13
+ class AppSrc
14
+ enable_simple_cache
15
+ common_constructor :path do
16
+ self.path = path.to_pathname
17
+ source_stereotypes_mixins
18
+ end
19
+
20
+ delegate :to_s, to: :path
21
+
22
+ def locale
23
+ configuration.if_present(&:locale) || ::I18n.default_locale
24
+ end
25
+
26
+ # Backward compatibility with [Avm::Launcher::Paths::Logical].
27
+ # @return [Avm::Launcher::Paths::Real].
28
+ def real
29
+ ::Avm::Launcher::Paths::Real.new(path.to_path)
30
+ end
31
+
32
+ def run_job(job, job_args = [])
33
+ stereotypes_jobs(job, job_args).each(&:run)
34
+ end
35
+
36
+ private
37
+
38
+ def avm_instance_uncached
39
+ ::Avm::AppSrc::Base.new(path)
40
+ end
41
+
42
+ # @return [Avm::Apps::Sources::Configuration]
43
+ def configuration_uncached
44
+ ::Avm::AppSrc::Configuration.find_in_path(path)
45
+ end
46
+
47
+ def stereotypes_jobs(job, job_args)
48
+ job_class_method = "#{job}_class"
49
+ r = []
50
+ stereotypes.each do |stereotype|
51
+ r << stereotype.send(job_class_method).new(self, *job_args) if
52
+ stereotype.send(job_class_method).present?
53
+ end
54
+ r.sort { |a, b| ::Avm::Projects::Stereotype::JobComparator.new(a, b).result }
55
+ end
56
+
57
+ def stereotypes_uncached
58
+ ::Avm::Projects::Stereotypes.list.select { |s| s.match?(self) }
59
+ end
60
+
61
+ def source_stereotypes_mixins
62
+ stereotypes.each do |s|
63
+ s.local_project_mixin_module.if_present { |v| singleton_class.include(v) }
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -12,8 +12,22 @@ module Avm
12
12
  end
13
13
 
14
14
  def run
15
- infov 'Path', runner_context.call(:instance).path
16
- infov 'Stereotypes', runner_context.call(:instance).stereotypes.map(&:label).join(', ')
15
+ infov 'Path', instance.path
16
+ infov 'Stereotypes', instance.stereotypes.map(&:label).join(', ')
17
+ show_subs
18
+ end
19
+
20
+ private
21
+
22
+ def show_subs
23
+ infov 'Sub applications', instance.avm_instance.subs.count
24
+ instance.avm_instance.subs.each do |subapp|
25
+ infov ' * ', subapp.relative_path
26
+ end
27
+ end
28
+
29
+ def instance
30
+ runner_context.call(:instance)
17
31
  end
18
32
  end
19
33
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/fs_cache'
4
3
  require 'avm/ruby/bundler/incompatible_parser'
5
4
  require 'eac_ruby_base0/core_ext'
6
5
 
@@ -36,9 +35,8 @@ module Avm
36
35
  fs_cache.content_path
37
36
  end
38
37
 
39
- def fs_cache_uncached
40
- ::Avm.fs_cache.child(self.class.name.variableize)
41
- .child(instance.path.to_s.variableize)
38
+ def fs_cache
39
+ super.child(instance.path.to_s.variableize)
42
40
  end
43
41
 
44
42
  def gem_title(gem_in_conflict)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/app_src'
3
+ require 'avm/tools/app_src'
4
4
  require 'eac_cli/core_ext'
5
5
 
6
6
  module Avm
@@ -22,7 +22,7 @@ module Avm
22
22
  private
23
23
 
24
24
  def instance_uncached
25
- ::Avm::AppSrc.new(instance_path)
25
+ ::Avm::Tools::AppSrc.new(instance_path)
26
26
  end
27
27
 
28
28
  def instance_path_uncached
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/config'
4
3
  require 'avm/self'
5
4
  require 'avm/tools/core_ext'
5
+ require 'eac_config/node'
6
6
 
7
7
  module Avm
8
8
  module Tools
@@ -23,7 +23,7 @@ module Avm
23
23
 
24
24
  # @return [[EacCli::Config]]
25
25
  def config_node
26
- ::Avm::Apps::Config.current
26
+ ::EacConfig::Node.context.current
27
27
  end
28
28
 
29
29
  def run_add
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/config'
4
3
  require 'avm/launcher/git/base'
5
4
  require 'avm/git/commit'
5
+ require 'eac_config/node'
6
6
 
7
7
  module Avm
8
8
  module Tools
@@ -91,7 +91,7 @@ module Avm
91
91
  end
92
92
 
93
93
  def variables_source
94
- instance || ::Avm::Apps::Config.current
94
+ instance || ::EacConfig::Node.context.current
95
95
  end
96
96
 
97
97
  def instance_uncached
@@ -19,7 +19,7 @@ module Avm
19
19
  end
20
20
 
21
21
  def run
22
- ::Avm::Apps::Config.context.on(::Avm::Self.build_config) { super }
22
+ ::EacConfig::Node.context.on(::Avm::Self.build_config) { super }
23
23
  end
24
24
  end
25
25
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.106.0'
5
+ VERSION = '0.107.0'
6
6
  end
7
7
  end
@@ -16,6 +16,9 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency 'eac_git', '~> 0.6'
17
17
  s.add_dependency 'eac_ruby_utils', '~> 0.68'
18
18
  s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
19
+ s.add_dependency 'filesize', '~> 0.2'
20
+ s.add_dependency 'htmlbeautifier', '~> 1.3', '>= 1.3.1'
21
+ s.add_dependency 'minitar', '~> 0.9'
19
22
 
20
23
  s.add_development_dependency 'aranha-parsers', '~> 0.7', '>= 0.7.2'
21
24
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_git'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module AppSrc
8
+ class Base
9
+ enable_simple_cache
10
+ enable_listable
11
+ lists.add_symbol :option, :parent
12
+ common_constructor :path, :options, default: [{}] do
13
+ self.path = path.to_pathname
14
+ self.options = self.class.lists.option.hash_keys_validate!(options)
15
+ end
16
+
17
+ delegate :to_s, to: :path
18
+
19
+ # @return [Avm::AppSrc::Base]
20
+ def parent
21
+ options[OPTION_PARENT]
22
+ end
23
+
24
+ # @return [Pathname]
25
+ def relative_path
26
+ return path if parent.blank?
27
+
28
+ path.relative_path_from(parent.path)
29
+ end
30
+
31
+ # @return [Enumerable<Avm::AppSrc::Base>]
32
+ def subs
33
+ git_repo.subrepos
34
+ .map { |subrepo| self.class.new(subrepo.subpath.expand_path(path), parent: self) }
35
+ end
36
+
37
+ private
38
+
39
+ # @return [EacGit::Local]
40
+ def git_repo_uncached
41
+ ::EacGit::Local.new(path)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+ require 'i18n'
5
+
6
+ module Avm
7
+ module AppSrc
8
+ class Configuration < ::EacConfig::OldConfigs
9
+ LOCALE_KEY = :locale
10
+
11
+ def locale
12
+ read_entry(LOCALE_KEY) || ::I18n.default_locale
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module AppSrc
5
+ class Configuration < ::EacConfig::OldConfigs
6
+ RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
7
+ RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
8
+
9
+ def rubocop_command
10
+ read_command(RUBOCOP_COMMAND_KEY)
11
+ end
12
+
13
+ def rubocop_gemfile
14
+ gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
15
+ return nil if gemfile_path.blank?
16
+
17
+ gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
18
+ return gemfile_path if gemfile_path.file?
19
+
20
+ raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+
5
+ module Avm
6
+ module AppSrc
7
+ class Configuration < ::EacConfig::OldConfigs
8
+ BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
9
+ TEST_COMMAND_KEY = 'test.command'
10
+
11
+ def any_test_command
12
+ bundle_test_command || test_command
13
+ end
14
+
15
+ def test_command
16
+ read_command(TEST_COMMAND_KEY)
17
+ end
18
+
19
+ def bundle_test_command
20
+ read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
21
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
22
+ ::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/old_configs'
4
+ require 'eac_ruby_utils/core_ext'
5
+ require 'yaml'
6
+
7
+ module Avm
8
+ module AppSrc
9
+ class Configuration < ::EacConfig::OldConfigs
10
+ require_sub __FILE__
11
+
12
+ FILENAMES = %w[.avm.yml .avm.yaml].freeze
13
+
14
+ class << self
15
+ def find_by_path(path)
16
+ path = ::Pathname.new(path.to_s) unless path.is_a?(::Pathname)
17
+ internal_find_path(path.expand_path)
18
+ end
19
+
20
+ def find_in_path(path)
21
+ absolute_pathname = path.to_pathname.expand_path
22
+ if absolute_pathname.directory?
23
+ FILENAMES.each do |filename|
24
+ file = absolute_pathname.join(filename)
25
+ return new(file) if file.exist?
26
+ end
27
+ end
28
+ nil
29
+ end
30
+
31
+ private
32
+
33
+ def internal_find_path(absolute_pathname)
34
+ r = find_in_path(absolute_pathname)
35
+ return r if r.present?
36
+
37
+ internal_find_path(absolute_pathname.dirname) unless absolute_pathname.root?
38
+ end
39
+ end
40
+
41
+ def initialize(path)
42
+ super(nil, storage_path: path)
43
+ end
44
+
45
+ # Utility to read a configuration as a [EacRubyUtils::Envs::Command].
46
+ # @return [EacRubyUtils::Envs::Command]
47
+ def read_command(key)
48
+ read_entry(key).if_present do |v|
49
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
50
+ ::EacRubyUtils::Envs.local.command(args).chdir(::File.dirname(storage_path))
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module AppSrc
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/files/info'
3
+ require 'eac_fs/file_info'
4
4
  require 'ostruct'
5
5
 
6
6
  module Avm
@@ -50,7 +50,7 @@ module Avm
50
50
  end
51
51
 
52
52
  def match_by_type?(file)
53
- info = ::Avm::Files::Info.new(file)
53
+ info = ::EacFs::FileInfo.new(file)
54
54
  return unless info.content_type.type == 'text'
55
55
 
56
56
  valid_types.include?(info.content_type.subtype)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/executables'
3
4
  require 'avm/files/formatter/formats/generic_plain'
4
5
 
5
6
  module Avm
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/executables'
3
4
  require 'avm/files/formatter/formats/generic_plain'
4
5
 
5
6
  module Avm
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/executables'
3
4
  require 'avm/files/formatter/formats/generic_plain'
4
5
 
5
6
  module Avm
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/executables'
3
4
  require 'avm/files/formatter/formats/generic_plain'
4
5
 
5
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/files/info'
3
+ require 'eac_fs/file_info'
4
4
 
5
5
  module Avm
6
6
  module Files
@@ -39,7 +39,7 @@ module Avm
39
39
  private
40
40
 
41
41
  def original_info_uncached
42
- ::Avm::Files::Info.new(path)
42
+ ::EacFs::FileInfo.new(path)
43
43
  end
44
44
 
45
45
  def original_charset_uncached
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/sources/configuration'
3
+ require 'avm/app_src/configuration'
4
4
  require 'avm/result'
5
5
  require 'eac_ruby_utils/fs/temp'
6
6
 
@@ -36,7 +36,7 @@ module Avm
36
36
  end
37
37
 
38
38
  def configuration_uncached
39
- ::Avm::Apps::Sources::Configuration.find_by_path(@git)
39
+ ::Avm::AppSrc::Configuration.find_by_path(@git)
40
40
  end
41
41
  end
42
42
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/fs_cache'
4
3
  require 'eac_ruby_utils/core_ext'
5
4
  require 'eac_ruby_utils/ruby'
6
5
 
@@ -53,8 +52,8 @@ module Avm
53
52
  end
54
53
 
55
54
  def root_cache
56
- ::Avm.fs_cache.child('git', 'revision_test', git_absolute_path.parameterize, sha1,
57
- options.fetch(:test_command).to_s.parameterize)
55
+ fs_cache.child(git_absolute_path.parameterize, sha1,
56
+ options.fetch(:test_command).to_s.parameterize)
58
57
  end
59
58
 
60
59
  def run_test
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/jobs/variables_source'
4
+ require 'eac_cli/core_ext'
5
+
6
+ module Avm
7
+ module Jobs
8
+ module Base
9
+ common_concern do
10
+ include ::ActiveSupport::Callbacks
11
+
12
+ enable_speaker
13
+ enable_simple_cache
14
+ enable_listable
15
+ common_constructor :instance, :options, default: [{}] do
16
+ if option_list.present?
17
+ self.options = option_list.hash_keys_validate!(options.symbolize_keys)
18
+ end
19
+ end
20
+ define_callbacks(*jobs)
21
+ end
22
+
23
+ module ClassMethods
24
+ def jobs
25
+ const_get('JOBS').dup
26
+ end
27
+ end
28
+
29
+ module InstanceMethods
30
+ def option_list
31
+ nil
32
+ end
33
+
34
+ def run
35
+ start_banner if respond_to?(:start_banner)
36
+ run_jobs
37
+ ::Avm::Result.success('Done!')
38
+ rescue ::Avm::Result::Error => e
39
+ e.to_result
40
+ end
41
+
42
+ def variables_source
43
+ ::Avm::Jobs::VariablesSource.new(self, instance)
44
+ end
45
+
46
+ protected
47
+
48
+ def run_jobs
49
+ jobs.each do |job|
50
+ run_callbacks job do
51
+ send(job)
52
+ end
53
+ end
54
+ end
55
+
56
+ def jobs
57
+ self.class.jobs
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Jobs
7
+ class VariablesSource
8
+ common_constructor :job, :instance
9
+
10
+ def read_entry(path, options = {})
11
+ entry_from_job(path) || instance.read_entry(path, options)
12
+ end
13
+
14
+ private
15
+
16
+ def entry_from_job(path)
17
+ method = path.gsub('.', '_').underscore
18
+ return job.send(method) if job.respond_to?(method, true)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -3,9 +3,7 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module Avm
6
- module Apps
7
- module Jobs
8
- require_sub __FILE__
9
- end
6
+ module Jobs
7
+ require_sub __FILE__
10
8
  end
11
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.3.2'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.name = 'avm-apps'
9
9
  s.version = Avm::Apps::VERSION
10
10
  s.authors = ['Eduardo H. Bogoni']
11
- s.summary = 'AVM components for applications.'
11
+ s.summary = 'DEPRECATED: use gem "avm" instead.'
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14