avm-tools 0.94.0 → 0.96.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/app_src.rb +60 -0
- data/lib/avm/core_ext.rb +4 -0
- data/lib/avm/eac_webapp_base0/instance.rb +5 -2
- data/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
- data/lib/avm/eac_webapp_base0/runner/data.rb +1 -0
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +1 -1
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +1 -1
- data/lib/avm/git/file_auto_fixup.rb +12 -2
- data/lib/avm/instances/base.rb +6 -12
- data/lib/avm/instances/base/entry_keys.rb +17 -0
- data/lib/{eac_launcher → avm/launcher}/instances/error.rb +0 -0
- data/lib/avm/launcher/instances/runner_helper.rb +42 -0
- data/lib/avm/patches/class.rb +4 -0
- data/lib/avm/patches/eac_ruby_gems_utils.rb +4 -0
- data/lib/avm/patches/object.rb +4 -0
- data/lib/avm/patches/object/fs_cache.rb +16 -0
- data/lib/avm/ruby/bundler.rb +11 -0
- data/lib/avm/ruby/bundler/incompatible_parser.rb +25 -0
- data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +25 -0
- data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +39 -0
- data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +19 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +73 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +31 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +19 -0
- data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +26 -0
- data/lib/avm/ruby/gems/generator.rb +1 -5
- data/lib/avm/tools/runner/{local_project.rb → app_src.rb} +3 -3
- data/lib/avm/tools/runner/{local_project → app_src}/eac_asciidoctor_base0.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/eac_asciidoctor_base0/build.rb +2 -3
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_chapters.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_single.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/info.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/info.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/ruby.rb +3 -7
- data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler.rb +4 -8
- data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler/gemfile_lock.rb +11 -14
- data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +84 -0
- data/lib/avm/tools/runner/{local_project → app_src}/test.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/update.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/version_bump.rb +1 -1
- data/lib/avm/tools/runner/git/subrepo/fix.rb +1 -1
- data/lib/avm/tools/runner/launcher.rb +3 -6
- data/lib/avm/tools/runner/launcher/instances.rb +10 -21
- data/lib/avm/tools/runner/launcher/projects.rb +10 -18
- data/lib/avm/tools/runner/launcher/publish.rb +18 -26
- data/lib/avm/tools/runner/ruby/rubocop.rb +9 -25
- data/lib/avm/tools/runner/self.rb +7 -15
- data/lib/avm/tools/runner/self/docker.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- data/lib/eac_launcher/instances.rb +1 -1
- data/template/avm/ruby/gems/generator/static/spec/rubocop_spec.rb +1 -5
- data/template/avm/ruby/gems/generator/static/spec/spec_helper.rb +2 -0
- data/vendor/avm-apps/avm-apps.gemspec +1 -1
- data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
- data/vendor/avm-apps/spec/rubocop_spec.rb +1 -5
- data/vendor/avm-apps/spec/spec_helper.rb +3 -0
- data/vendor/eac_cli/eac_cli.gemspec +1 -1
- data/vendor/eac_cli/lib/eac_cli/core_ext.rb +2 -0
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +5 -1
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +3 -1
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +4 -2
- data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +2 -1
- data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
- data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +8 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with_set.rb +50 -0
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_cli/spec/spec_helper.rb +3 -0
- data/vendor/eac_docker/eac_docker.gemspec +1 -1
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_docker/spec/spec_helper.rb +3 -0
- data/vendor/eac_git/eac_git.gemspec +2 -1
- data/vendor/eac_git/lib/eac_git/local.rb +4 -0
- data/vendor/eac_git/lib/eac_git/local/commit.rb +53 -0
- data/vendor/eac_git/lib/eac_git/local/commit/changed_file.rb +46 -0
- data/vendor/eac_git/lib/eac_git/local/commit/diff_tree_line.rb +32 -0
- data/vendor/eac_git/lib/eac_git/local/dirty_files.rb +2 -3
- data/vendor/eac_git/lib/eac_git/rspec.rb +6 -1
- data/{lib/avm/git/spec_helper.rb → vendor/eac_git/lib/eac_git/rspec/stubbed_git_local_repo.rb} +16 -13
- data/vendor/eac_git/lib/eac_git/version.rb +1 -1
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec.rb +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.source.out +2 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit_spec.rb +58 -0
- data/vendor/eac_git/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_git/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +31 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +10 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +5 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +5 -0
- data/{lib/avm/local_projects.rb → vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb} +2 -2
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +36 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +52 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +42 -0
- data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +1 -1
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +7 -10
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +9 -2
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -5
- data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +9 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +8 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +18 -5
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +9 -0
- data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
- data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
- metadata +77 -32
- data/lib/avm/local_projects/instance.rb +0 -62
- data/lib/eac_launcher/instances/runner_helper.rb +0 -42
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ef7523f40504ec0ae7da047ae97a104ee39e70cfc7ce6a799391615e8a62acf
|
4
|
+
data.tar.gz: cc8d89ba7e4f9025fd0553f4f4d448d7b11c3a65d07ec5f46646619f7b517baa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e6b348ab5fdd9c2df75c7959dc1b9ef6202e44fde8af352603c3f8883de2c5ec5abd46f0fb0f6771e7a78befdf97fd109f17c6622dffb942ae758ac54a3998
|
7
|
+
data.tar.gz: 32835edd010fc51fdd12ca6a0c85c4950c946463ec067de823f96d4bb24dc70bfae8e94fe4d1c3cfa66a882b2e8566b0ea3c79bd46ffd9c0a51edd699207deb9
|
data/lib/avm/app_src.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/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::Instances::Configuration]
|
36
|
+
def configuration_uncached
|
37
|
+
::Avm::Instances::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
|
data/lib/avm/core_ext.rb
ADDED
@@ -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
|
-
|
30
|
-
|
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
|
@@ -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
|
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
|
@@ -11,7 +11,7 @@ module Avm
|
|
11
11
|
enable_listable
|
12
12
|
|
13
13
|
common_constructor :git, :path, :rules do
|
14
|
-
self.path = path.to_pathname
|
14
|
+
self.path = path.to_pathname.expand_path(git.root_path)
|
15
15
|
end
|
16
16
|
|
17
17
|
COMMITS_SEARCH_INTERVAL = 'origin/master..HEAD'
|
@@ -44,11 +44,21 @@ module Avm
|
|
44
44
|
return false if commit_info.blank?
|
45
45
|
|
46
46
|
infov ' Commit arguments', ::Shellwords.join(commit_args)
|
47
|
-
|
47
|
+
run_git_add_and_commit
|
48
48
|
success ' Commited'
|
49
49
|
true
|
50
50
|
end
|
51
51
|
|
52
|
+
def run_git_add_and_commit
|
53
|
+
git.execute!('reset', '--soft', 'HEAD')
|
54
|
+
if path.exist?
|
55
|
+
git.execute!('add', git_relative_path)
|
56
|
+
else
|
57
|
+
git.execute!('rm', '-f', git_relative_path)
|
58
|
+
end
|
59
|
+
git.execute!('commit', *commit_args)
|
60
|
+
end
|
61
|
+
|
52
62
|
def commits_uncached
|
53
63
|
git.execute!('log', '--pretty=format:%H', COMMITS_SEARCH_INTERVAL, '--', path)
|
54
64
|
.each_line.map { |sha1| ::Avm::Git::Commit.new(git, sha1.strip) }
|
data/lib/avm/instances/base.rb
CHANGED
@@ -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
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
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(
|
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
|
File without changes
|
@@ -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,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,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
|
@@ -0,0 +1,19 @@
|
|
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 InGemfile < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
|
11
|
+
LINE_PARSER = /In Gemfile:/
|
12
|
+
.to_parser { |_m| new }
|
13
|
+
|
14
|
+
common_constructor
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|