avm-tools 0.94.1 → 0.97.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/app_src.rb +60 -0
  3. data/lib/avm/core_ext.rb +4 -0
  4. data/lib/avm/eac_asciidoctor_base0/deploy.rb +5 -5
  5. data/lib/avm/eac_webapp_base0/instance.rb +5 -2
  6. data/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
  7. data/lib/avm/eac_webapp_base0/runner/data.rb +1 -0
  8. data/lib/avm/eac_webapp_base0/runner/data/dump.rb +1 -1
  9. data/lib/avm/eac_webapp_base0/runner/data/load.rb +1 -1
  10. data/lib/avm/git/issue/complete/_test.rb +2 -2
  11. data/lib/avm/instances/base.rb +6 -12
  12. data/lib/avm/instances/base/entry_keys.rb +17 -0
  13. data/lib/{eac_launcher → avm/launcher}/instances/error.rb +0 -0
  14. data/lib/avm/launcher/instances/runner_helper.rb +42 -0
  15. data/lib/avm/patches/class.rb +4 -0
  16. data/lib/avm/patches/eac_ruby_gems_utils.rb +4 -0
  17. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +2 -2
  18. data/lib/avm/patches/object.rb +4 -0
  19. data/lib/avm/patches/object/fs_cache.rb +16 -0
  20. data/lib/avm/ruby/bundler.rb +11 -0
  21. data/lib/avm/ruby/bundler/incompatible_parser.rb +25 -0
  22. data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +25 -0
  23. data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +39 -0
  24. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +19 -0
  25. data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +73 -0
  26. data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +31 -0
  27. data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +19 -0
  28. data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +26 -0
  29. data/lib/avm/ruby/gems/generator.rb +1 -5
  30. data/lib/avm/ruby/rubocop/_configured.rb +2 -2
  31. data/lib/avm/tools/runner/{local_project.rb → app_src.rb} +3 -3
  32. data/lib/avm/tools/runner/{local_project → app_src}/eac_asciidoctor_base0.rb +1 -1
  33. data/lib/avm/tools/runner/{local_project → app_src}/eac_asciidoctor_base0/build.rb +19 -7
  34. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0.rb +1 -1
  35. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_chapters.rb +1 -1
  36. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_single.rb +1 -1
  37. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/info.rb +1 -1
  38. data/lib/avm/tools/runner/{local_project → app_src}/info.rb +1 -1
  39. data/lib/avm/tools/runner/{local_project → app_src}/ruby.rb +1 -1
  40. data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler.rb +4 -8
  41. data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler/gemfile_lock.rb +11 -14
  42. data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +84 -0
  43. data/lib/avm/tools/runner/{local_project → app_src}/test.rb +1 -1
  44. data/lib/avm/tools/runner/{local_project → app_src}/update.rb +1 -1
  45. data/lib/avm/tools/runner/{local_project → app_src}/version_bump.rb +1 -1
  46. data/lib/avm/tools/runner/launcher.rb +3 -6
  47. data/lib/avm/tools/runner/launcher/instances.rb +10 -21
  48. data/lib/avm/tools/runner/launcher/projects.rb +10 -18
  49. data/lib/avm/tools/runner/launcher/publish.rb +18 -26
  50. data/lib/avm/tools/runner/ruby/rubocop.rb +9 -25
  51. data/lib/avm/tools/runner/self.rb +7 -15
  52. data/lib/avm/tools/runner/self/docker.rb +1 -1
  53. data/lib/avm/tools/version.rb +1 -1
  54. data/lib/eac_launcher/instances.rb +1 -1
  55. data/template/avm/ruby/gems/generator/static/spec/rubocop_spec.rb +1 -5
  56. data/template/avm/ruby/gems/generator/static/spec/spec_helper.rb +2 -0
  57. data/vendor/avm-apps/avm-apps.gemspec +1 -1
  58. data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +57 -0
  59. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +18 -0
  60. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +26 -0
  61. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +29 -0
  62. data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
  63. data/vendor/avm-apps/spec/rubocop_spec.rb +1 -5
  64. data/vendor/avm-apps/spec/spec_helper.rb +3 -0
  65. data/vendor/avm-eac_asciidoctor_base0/Gemfile +5 -0
  66. data/vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +19 -0
  67. data/{lib/avm/local_projects.rb → vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb} +1 -1
  68. data/{lib/avm/eac_asciidoctor_base0/project.rb → vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb} +2 -4
  69. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +15 -0
  70. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +49 -0
  71. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +30 -0
  72. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +7 -0
  73. data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +3 -0
  74. data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +102 -0
  75. data/vendor/eac_cli/eac_cli.gemspec +1 -1
  76. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +5 -1
  77. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +3 -1
  78. data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
  79. data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +8 -1
  80. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  81. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -5
  82. data/vendor/eac_cli/spec/spec_helper.rb +3 -0
  83. data/vendor/eac_docker/eac_docker.gemspec +1 -1
  84. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  85. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
  86. data/vendor/eac_docker/spec/spec_helper.rb +3 -0
  87. data/vendor/eac_git/eac_git.gemspec +2 -1
  88. data/vendor/eac_git/lib/eac_git/local.rb +4 -0
  89. data/vendor/eac_git/lib/eac_git/local/commit.rb +53 -0
  90. data/vendor/eac_git/lib/eac_git/local/commit/changed_file.rb +46 -0
  91. data/vendor/eac_git/lib/eac_git/local/commit/diff_tree_line.rb +32 -0
  92. data/vendor/eac_git/lib/eac_git/rspec.rb +6 -1
  93. data/{lib/avm/git/spec_helper.rb → vendor/eac_git/lib/eac_git/rspec/stubbed_git_local_repo.rb} +16 -13
  94. data/vendor/eac_git/lib/eac_git/version.rb +1 -1
  95. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec.rb +13 -0
  96. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.source.out +1 -0
  97. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
  98. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.source.out +1 -0
  99. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
  100. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.source.out +1 -0
  101. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
  102. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.source.out +2 -0
  103. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
  104. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
  105. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
  106. data/vendor/eac_git/spec/lib/eac_git/local/commit_spec.rb +58 -0
  107. data/vendor/eac_git/spec/rubocop_spec.rb +1 -5
  108. data/vendor/eac_git/spec/spec_helper.rb +3 -0
  109. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  110. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
  111. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
  112. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  113. data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
  114. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -5
  115. data/vendor/eac_ruby_base0/spec/spec_helper.rb +3 -0
  116. data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +4 -3
  117. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +7 -10
  118. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +9 -2
  119. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  120. data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -5
  121. data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +3 -0
  122. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -1
  123. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
  124. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
  125. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +9 -1
  126. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +3 -2
  127. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +4 -2
  128. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
  129. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
  130. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
  131. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
  132. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
  133. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +18 -5
  134. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  135. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
  136. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +9 -0
  137. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
  138. data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
  139. metadata +90 -39
  140. data/lib/avm/eac_asciidoctor_base0/build.rb +0 -47
  141. data/lib/avm/eac_asciidoctor_base0/build/file.rb +0 -28
  142. data/lib/avm/instances/configuration.rb +0 -55
  143. data/lib/avm/instances/configuration/_locale.rb +0 -16
  144. data/lib/avm/instances/configuration/_rubocop.rb +0 -24
  145. data/lib/avm/instances/configuration/_tests.rb +0 -27
  146. data/lib/avm/local_projects/instance.rb +0 -62
  147. data/lib/eac_launcher/instances/runner_helper.rb +0 -42
  148. data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
  149. data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +0 -53
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dce4ced28e926994fcd39732b69129d78a0a84b4fa7327d4f717a8ea218be36e
4
- data.tar.gz: 0561dd8132497d54f2eecb2b933968aca705c3976a6ae198d8394257bf9f0d29
3
+ metadata.gz: 1f1e0a305ededda2855b91810dc19b61599d5160877ec4ce3ed6f30fef7fba53
4
+ data.tar.gz: 30b9f99be2526baec4a9f9c47717689a7addbfb554d81f7d8100aafbf4fb9e7b
5
5
  SHA512:
6
- metadata.gz: a63ff3adcd87aeaddcfee5045359c45d232bbc4d8d3dd4774a75d07feabc34493ee6432fe52a0b95e10aed80a3603a71f23dcfc5ae478e0dfd07cc331aeccfb1
7
- data.tar.gz: 83e4d3667c0f4dbe11c3421a27f786dce65cd698c0c1867d23dc16191c13c6cbc6574be40aa9c9728b4c69a72e267792ad6de892da13c0d34df0c864142e4f13
6
+ metadata.gz: 01aad2b75c533011cca20448bb5df00608d43124c905844d1f7c3bf9aa3a8f2c23258e3ad630df9c8fe32591f4d7e620253f9e7e2724e8ffebe89dcbc049c992
7
+ data.tar.gz: e94c3356ab0c629d8ba0c02e091fdb2da88cb9c4441142be581628abe2585e02af117177c255a436e64a1d7010ed0e3ce985ac25d689e17b84ecb473cd329af6
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/apps/sources/configuration'
4
+ require 'eac_launcher/paths/real'
5
+ require 'eac_ruby_utils/core_ext'
6
+ require 'avm/projects/stereotypes'
7
+ require 'i18n'
8
+
9
+ module Avm
10
+ class AppSrc
11
+ enable_simple_cache
12
+ common_constructor :path do
13
+ self.path = path.to_pathname
14
+ source_stereotypes_mixins
15
+ end
16
+
17
+ delegate :to_s, to: :path
18
+
19
+ def locale
20
+ configuration.if_present(&:locale) || ::I18n.default_locale
21
+ end
22
+
23
+ # Backward compatibility with [EacLauncher::Paths::Logical].
24
+ # @return [EacLauncher::Paths::Real].
25
+ def real
26
+ ::EacLauncher::Paths::Real.new(path.to_path)
27
+ end
28
+
29
+ def run_job(job, job_args = [])
30
+ stereotypes.each { |stereotype| run_stereotype_job(stereotype, job, job_args) }
31
+ end
32
+
33
+ private
34
+
35
+ # @return [Avm::Apps::Sources::Configuration]
36
+ def configuration_uncached
37
+ ::Avm::Apps::Sources::Configuration.find_in_path(path)
38
+ end
39
+
40
+ def run_stereotype_job(stereotype, job, job_args)
41
+ job_class_method = "#{job}_class"
42
+ if stereotype.send(job_class_method).present?
43
+ puts stereotype.label + ": #{job} class found. Running..."
44
+ stereotype.send(job_class_method).new(self, *job_args).run
45
+ else
46
+ puts stereotype.label + ": #{job} class not found"
47
+ end
48
+ end
49
+
50
+ def stereotypes_uncached
51
+ ::Avm::Projects::Stereotypes.list.select { |s| s.match?(self) }
52
+ end
53
+
54
+ def source_stereotypes_mixins
55
+ stereotypes.each do |s|
56
+ s.local_project_mixin_module.if_present { |v| singleton_class.include(v) }
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches'
4
+ require 'eac_ruby_base0/core_ext'
@@ -1,23 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/eac_webapp_base0/deploy'
4
- require 'avm/eac_asciidoctor_base0/project'
5
- require 'avm/eac_asciidoctor_base0/build'
4
+ require 'avm/eac_asciidoctor_base0/sources/base'
5
+ require 'avm/eac_asciidoctor_base0/sources/build'
6
6
 
7
7
  module Avm
8
8
  module EacAsciidoctorBase0
9
9
  class Deploy < ::Avm::EacWebappBase0::Deploy
10
10
  def build_content
11
- ::Avm::EacAsciidoctorBase0::Build.new(
11
+ ::Avm::EacAsciidoctorBase0::Sources::Build.new(
12
12
  project,
13
- ::Avm::EacAsciidoctorBase0::Build::OPTION_TARGET_DIRECTORY => build_dir
13
+ ::Avm::EacAsciidoctorBase0::Sources::Build::OPTION_TARGET_DIRECTORY => build_dir
14
14
  ).run
15
15
  end
16
16
 
17
17
  private
18
18
 
19
19
  def project_uncached
20
- ::Avm::EacAsciidoctorBase0::Project.new(
20
+ ::Avm::EacAsciidoctorBase0::Sources::Base.new(
21
21
  instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
22
22
  )
23
23
  end
@@ -9,6 +9,7 @@ require 'avm/eac_webapp_base0/deploy/file_unit'
9
9
  module Avm
10
10
  module EacWebappBase0
11
11
  class Instance < ::Avm::Instances::Base
12
+ require_sub __FILE__
12
13
  include ::Avm::Postgresql::InstanceWith
13
14
 
14
15
  FILES_UNITS = [].freeze
@@ -26,8 +27,10 @@ module Avm
26
27
  end
27
28
 
28
29
  def run_subcommand(subcommand_class, argv)
29
- parent = ::OpenStruct.new(instance: self)
30
- subcommand_class.new(argv: argv, parent: parent).run
30
+ subcommand_class.create(
31
+ argv: argv,
32
+ parent: ::Avm::EacWebappBase0::Instance::SubcommandParent.new(self)
33
+ ).run
31
34
  end
32
35
 
33
36
  def data_package
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacWebappBase0
7
+ class Instance < ::Avm::Instances::Base
8
+ class SubcommandParent
9
+ enable_simple_cache
10
+ common_constructor :instance
11
+
12
+ private
13
+
14
+ def runner_context_uncached
15
+ ::EacCli::Runner::Context.new(self, argv: runner_argv)
16
+ end
17
+
18
+ def runner_argv
19
+ [instance.class.name.split('::')[-2].dasherize, instance.id]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -9,6 +9,7 @@ module Avm
9
9
  require_sub __FILE__
10
10
  runner_with :help, :subcommands do
11
11
  desc 'Data utilities for EacRailsBase0 instances.'
12
+ subcommands
12
13
  end
13
14
  end
14
15
  end
@@ -15,7 +15,7 @@ module Avm
15
15
 
16
16
  runner_with :help do
17
17
  desc 'Dump utility for EacRailsBase instance.'
18
- bool_opt '-w', 'rewrite', 'Forces dump overwrite.'
18
+ bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
19
19
  arg_opt '-p', '--dump-path', 'Set DUMP_PATH variable.'
20
20
  end
21
21
 
@@ -9,7 +9,7 @@ module Avm
9
9
  class Runner < ::Avm::Instances::Runner
10
10
  class Data
11
11
  class Load
12
- runner_with :ĥelp do
12
+ runner_with :help do
13
13
  desc 'Load utility for EacRailsBase instance.'
14
14
  arg_opt '-S', '--source-instance', 'Informa a instância a ser extraída o dump.'
15
15
  pos_arg :dump_path, optional: true
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/configuration'
3
+ require 'avm/apps/sources/configuration'
4
4
  require 'avm/result'
5
5
  require 'eac_ruby_utils/fs/temp'
6
6
 
@@ -35,7 +35,7 @@ module Avm
35
35
  end
36
36
 
37
37
  def configuration_uncached
38
- ::Avm::Instances::Configuration.find_by_path(@git)
38
+ ::Avm::Apps::Sources::Configuration.find_by_path(@git)
39
39
  end
40
40
  end
41
41
  end
@@ -3,16 +3,13 @@
3
3
  require 'eac_ruby_utils/require_sub'
4
4
  require 'eac_ruby_utils/simple_cache'
5
5
  require 'avm/instances/entries'
6
- require 'avm/instances/entry_keys'
7
- ::EacRubyUtils.require_sub(__FILE__)
8
6
 
9
7
  module Avm
10
8
  module Instances
11
9
  class Base
12
- include ::EacRubyUtils::Listable
13
- include ::EacRubyUtils::SimpleCache
14
- include ::Avm::Instances::Base::AutoValues
15
- include ::Avm::Instances::Base::Dockerizable
10
+ enable_listable
11
+ enable_simple_cache
12
+ require_sub __FILE__, include_modules: true
16
13
  include ::Avm::Instances::Entries
17
14
 
18
15
  lists.add_string :access, :local, :ssh
@@ -36,11 +33,8 @@ module Avm
36
33
  end
37
34
  end
38
35
 
39
- attr_reader :application, :suffix
40
-
41
- def initialize(application, suffix)
42
- @application = application
43
- @suffix = suffix.to_s
36
+ common_constructor :application, :suffix do
37
+ self.suffix = suffix.to_s
44
38
  end
45
39
 
46
40
  def id
@@ -63,7 +57,7 @@ module Avm
63
57
  private
64
58
 
65
59
  def source_instance_uncached
66
- ::Avm::Instances::Base.by_id(read_entry(::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID))
60
+ ::Avm::Instances::Base.by_id(source_instance_id)
67
61
  end
68
62
  end
69
63
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/entry_keys'
4
+
5
+ module Avm
6
+ module Instances
7
+ class Base
8
+ module EntryKeys
9
+ ::Avm::Instances::EntryKeys.all.each do |key|
10
+ define_method key.to_s.variableize do
11
+ read_entry(key)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/console/docopt_runner'
4
+ require 'eac_ruby_utils/console/speaker'
5
+
6
+ module Avm
7
+ module Launcher
8
+ module Instances
9
+ class RunnerHelper < ::EacRubyUtils::Console::DocoptRunner
10
+ def context
11
+ @context ||= ::EacLauncher::Context.current
12
+ end
13
+
14
+ def find_instances(instance_name)
15
+ context.instances.select { |instance| instance_match?(instance, instance_name) }
16
+ end
17
+
18
+ def instance_match?(instance, instance_name)
19
+ ::File.fnmatch?(instance_name, instance.name)
20
+ end
21
+
22
+ def instances
23
+ if parsed.all?
24
+ context.instances
25
+ elsif parsed.pending?
26
+ context.pending_instances
27
+ else
28
+ parsed.instance_path.flat_map { |p| find_instances(p) }
29
+ end
30
+ end
31
+
32
+ def instance_stereotypes(instance)
33
+ instance.stereotypes.map(&:label).join(', ')
34
+ end
35
+
36
+ def instance_label(instance)
37
+ "#{instance.name} [#{instance_stereotypes(instance)}]"
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+ ::EacRubyUtils.require_sub(__FILE__)
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+ ::EacRubyUtils.require_sub(__FILE__)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/configuration'
3
+ require 'avm/apps/sources/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::Instances::Configuration.find_in_path(root)
16
+ ::Avm::Apps::Sources::Configuration.find_in_path(root)
17
17
  end
18
18
 
19
19
  def gemfile_path_uncached
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+ ::EacRubyUtils.require_sub(__FILE__)
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/self'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ class Object
7
+ class << self
8
+ def avm_fs_cache
9
+ ::Avm::Self.application.fs_cache.child(name.variableize)
10
+ end
11
+ end
12
+
13
+ def avm_fs_cache
14
+ self.class.avm_fs_cache.child(avm_fs_cache_object_id)
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Ruby
7
+ module Bundler
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Ruby
7
+ module Bundler
8
+ class IncompatibleParser
9
+ require_sub __FILE__
10
+
11
+ enable_simple_cache
12
+ attr_reader :gems_in_conflict
13
+
14
+ def initialize(path)
15
+ @gems_in_conflict = ::Avm::Ruby::Bundler::IncompatibleParser::LineBuffer
16
+ .from_file(path).gems_in_conflict.freeze
17
+ end
18
+
19
+ def data
20
+ gems_in_conflict.map(&:data)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'avm/ruby/bundler/incompatible_parser/line_parser_base'
5
+
6
+ module Avm
7
+ module Ruby
8
+ module Bundler
9
+ class IncompatibleParser
10
+ class DependsOn < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
+ LINE_PARSER = /(.+) was resolved to (.+), which depends on/
12
+ .to_parser { |m| new(m[1], m[2]) }
13
+
14
+ common_constructor :gem_name, :version do
15
+ self.version = ::Gem::Version.new(version)
16
+ end
17
+
18
+ def data
19
+ { gem_name: gem_name, version: version }
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'avm/ruby/bundler/incompatible_parser/line_parser_base'
5
+
6
+ module Avm
7
+ module Ruby
8
+ module Bundler
9
+ class IncompatibleParser
10
+ class GemConflict < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
+ LINE_PARSER = /Bundler could not find compatible versions for gem "(.+)":/
12
+ .to_parser { |m| new(m[1]) }
13
+
14
+ enable_simple_cache
15
+ common_constructor :gem_name
16
+
17
+ def add_depends_on(depends_on)
18
+ @depends_on_stack ||= []
19
+ @depends_on_stack << depends_on
20
+ end
21
+
22
+ def add_version_requirement(version_requirement)
23
+ version_requirement.stack = @depends_on_stack
24
+ versions_requirements << version_requirement
25
+ @depends_on_stack = nil
26
+ end
27
+
28
+ def data
29
+ { gem_name: gem_name, versions_requirements: versions_requirements.map(&:data) }
30
+ end
31
+
32
+ def versions_requirements
33
+ @versions_requirements ||= []
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end