eac_tools 0.36.1 → 0.37.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +28 -27
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +3 -1
- data/sub/avm/lib/avm/launcher/context.rb +6 -3
- data/sub/avm/lib/avm/launcher/paths/logical.rb +0 -1
- data/sub/avm/lib/avm/launcher/publish/base.rb +0 -2
- data/sub/avm/lib/avm/launcher/stereotype.rb +4 -4
- data/sub/avm/lib/avm/launcher_stereotypes.rb +9 -0
- data/sub/avm/lib/avm/registry/launcher_stereotypes.rb +11 -0
- data/sub/avm/lib/avm/registry.rb +2 -2
- data/sub/avm/lib/avm/rspec/setup/launcher.rb +19 -0
- data/sub/avm/lib/avm/rspec/setup.rb +4 -0
- data/sub/avm/lib/avm/rspec/source_generator.rb +16 -0
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher/gem/build.rb +1 -0
- data/sub/{avm-tools/lib/avm/projects/stereotypes/ruby_gem → avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher_stereotypes/base}/local_project_mixin.rb +3 -3
- data/sub/{avm-tools/lib/avm/projects/stereotypes/ruby_gem → avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher_stereotypes/base}/publish.rb +4 -4
- data/sub/{avm-tools/lib/avm/projects/stereotypes/ruby_gem.rb → avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher_stereotypes/base.rb} +5 -5
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher_stereotypes.rb +11 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rspec/setup.rb +16 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rspec/source_generator.rb +22 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rspec.rb +11 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/{avm-tools/spec/lib/avm/launcher/ruby → avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher}/gem/build_spec.rb +7 -4
- data/sub/{avm-tools/spec/lib/avm/launcher/ruby → avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher}/gem/specification_spec.rb +13 -4
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher_stereotypes/base/publish_spec.rb +24 -0
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher_stereotypes/base_spec.rb +23 -0
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +9 -0
- data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +4 -0
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +2 -2
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/build.rb +1 -1
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/{git_info.rb → scm.rb} +10 -5
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/version.rb +2 -2
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy.rb +3 -2
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-git/avm-git.gemspec +4 -3
- data/sub/avm-git/lib/avm/git/launcher/base/underlying.rb +8 -10
- data/sub/avm-git/lib/avm/git/launcher/error.rb +3 -1
- data/sub/avm-git/lib/avm/git/launcher/warp_base.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git/local_project_mixin.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git/publish.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git/warp.rb +3 -3
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git_subrepo/publish.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git_subrepo/warp.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git_subrepo.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git_subtree/publish.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git_subtree/warp.rb +2 -2
- data/sub/{avm-tools/lib/avm/projects/stereotypes → avm-git/lib/avm/git/launcher_stereotypes}/git_subtree.rb +6 -6
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/provider.rb +22 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes.rb +11 -0
- data/sub/avm-git/lib/avm/git/version.rb +1 -1
- data/sub/{avm-tools/spec/lib/avm/launcher/git → avm-git/spec/lib/avm/git/launcher}/base_spec.rb +5 -5
- data/sub/avm-tools/avm-tools.gemspec +4 -4
- data/sub/avm-tools/lib/avm/projects/stereotypes.rb +4 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher_stereotypes/list.rb +42 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher_stereotypes.rb +16 -0
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/avm-tools/spec/lib/avm/launcher/context_spec.rb +3 -3
- data/sub/avm-tools/spec/lib/avm/projects/stereotypes/git_subrepo/publish_spec.rb +3 -3
- data/sub/avm-tools/spec/lib/avm/projects/stereotypes/git_subrepo/warp_spec.rb +3 -3
- data/sub/avm-tools/spec/lib/avm/tools/runner/launcher_stereotypes/list_spec.rb +17 -0
- data/sub/eac_git/eac_git.gemspec +1 -1
- data/sub/eac_git/lib/eac_git/local/remote.rb +12 -1
- data/sub/eac_git/lib/eac_git/remote.rb +10 -5
- data/sub/eac_git/lib/eac_git/{remote → remote_like}/ls_result.rb +1 -1
- data/sub/eac_git/lib/eac_git/remote_like.rb +32 -0
- data/sub/eac_git/lib/eac_git/version.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/exec_error.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/execute_result.rb +47 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +3 -40
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/setup_manager.rb +17 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +8 -2
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/rspec/setup/setup_manager_spec.rb +17 -0
- metadata +56 -38
- data/sub/avm-tools/spec/lib/avm/projects/stereotypes/ruby_gem/publish_spec.rb +0 -19
- data/sub/avm-tools/spec/lib/avm/projects/stereotypes/ruby_gem_spec.rb +0 -22
@@ -38,7 +38,7 @@ module Avm
|
|
38
38
|
|
39
39
|
def build_content
|
40
40
|
infom 'Writing Git source code...'
|
41
|
-
|
41
|
+
scm.commit(commit_reference).deploy_to_env_path(
|
42
42
|
build_dir_env,
|
43
43
|
build_dir
|
44
44
|
).variables_source_set(variables_source).run
|
data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/{git_info.rb → scm.rb}
RENAMED
@@ -4,8 +4,8 @@ module Avm
|
|
4
4
|
module EacWebappBase0
|
5
5
|
module Instances
|
6
6
|
class Deploy
|
7
|
-
module
|
8
|
-
def
|
7
|
+
module Scm
|
8
|
+
def commit_reference_uncached
|
9
9
|
git_fetch
|
10
10
|
r = git.rev_parse(git_reference_found)
|
11
11
|
return r if r
|
@@ -15,7 +15,7 @@ module Avm
|
|
15
15
|
|
16
16
|
def git_fetch_uncached
|
17
17
|
infom "Fetching remote \"#{git_remote_name}\" from \"#{git_repository_path}\"..."
|
18
|
-
git.
|
18
|
+
git.remote(git_remote_name).fetch
|
19
19
|
end
|
20
20
|
|
21
21
|
def git_reference
|
@@ -31,7 +31,7 @@ module Avm
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def git_remote_hashs_uncached
|
34
|
-
git.
|
34
|
+
git.remote(git_remote_name).ls.hashes
|
35
35
|
end
|
36
36
|
|
37
37
|
def git_remote_name
|
@@ -44,7 +44,7 @@ module Avm
|
|
44
44
|
|
45
45
|
# @return [EacGit::Local]
|
46
46
|
def git_uncached
|
47
|
-
|
47
|
+
scm.git_repo
|
48
48
|
end
|
49
49
|
|
50
50
|
def instance_branch
|
@@ -58,6 +58,11 @@ module Avm
|
|
58
58
|
def master_branch
|
59
59
|
remote_branch('master')
|
60
60
|
end
|
61
|
+
|
62
|
+
# @return [Avm::Scms::Base]
|
63
|
+
def scm
|
64
|
+
instance.application.local_source.scm
|
65
|
+
end
|
61
66
|
end
|
62
67
|
end
|
63
68
|
end
|
@@ -8,11 +8,11 @@ module Avm
|
|
8
8
|
VERSION_TARGET_PATH = 'VERSION'
|
9
9
|
|
10
10
|
def version
|
11
|
-
([::Time.now,
|
11
|
+
([::Time.now, commit_reference] + version_git_refs).join('|')
|
12
12
|
end
|
13
13
|
|
14
14
|
def version_git_refs
|
15
|
-
git_remote_hashs.select { |_name, sha1| sha1 ==
|
15
|
+
git_remote_hashs.select { |_name, sha1| sha1 == commit_reference }.keys
|
16
16
|
.map { |ref| ref.gsub(%r{\Arefs/}, '') }.reject { |ref| ref == 'HEAD' }
|
17
17
|
end
|
18
18
|
|
@@ -38,7 +38,7 @@ module Avm
|
|
38
38
|
infov 'Git reference (User)', git_reference.if_present('- BLANK -')
|
39
39
|
infov 'Git remote name', git_remote_name
|
40
40
|
infov 'Git reference (Found)', git_reference_found
|
41
|
-
infov 'Git commit SHA1',
|
41
|
+
infov 'Git commit SHA1', commit_reference
|
42
42
|
infov 'Appended directories', appended_directories
|
43
43
|
end
|
44
44
|
|
@@ -50,7 +50,8 @@ module Avm
|
|
50
50
|
|
51
51
|
def assert_instance_branch
|
52
52
|
infom 'Setting instance branch...'
|
53
|
-
git.
|
53
|
+
git.command('push', git_remote_name, "#{commit_reference}:refs/heads/#{instance.id}",
|
54
|
+
'-f').execute!
|
54
55
|
end
|
55
56
|
|
56
57
|
def request_test
|
data/sub/avm-git/avm-git.gemspec
CHANGED
@@ -12,10 +12,11 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.50'
|
16
16
|
s.add_dependency 'avm-files', '~> 0.4', '>= 0.4.1'
|
17
|
-
s.add_dependency 'eac_git', '~> 0.
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
17
|
+
s.add_dependency 'eac_git', '~> 0.13'
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.105'
|
19
|
+
s.add_dependency 'git', '~> 1.12'
|
19
20
|
|
20
21
|
s.add_development_dependency 'aranha-parsers', '~> 0.8', '>= 0.8.5'
|
21
22
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
|
@@ -19,16 +19,14 @@ module Avm
|
|
19
19
|
r
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
def system!(*args)
|
31
|
-
command(*args).system!
|
22
|
+
%w[execute execute! system system!].each do |exec_type|
|
23
|
+
define_method exec_type do |*args|
|
24
|
+
begin
|
25
|
+
command(*args).send(exec_type)
|
26
|
+
rescue ::EacRubyUtils::Envs::Command::ExecError
|
27
|
+
raise ::Avm::Git::Launcher::Error
|
28
|
+
end
|
29
|
+
end
|
32
30
|
end
|
33
31
|
|
34
32
|
def init
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/launcher/errors/base'
|
4
|
+
|
3
5
|
module Avm
|
4
6
|
module Git
|
5
7
|
module Launcher
|
6
|
-
class Error <
|
8
|
+
class Error < ::Avm::Launcher::Errors::Base
|
7
9
|
def initialize(git_instance, message)
|
8
10
|
super("#{message} (Repository: #{git_instance})")
|
9
11
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'avm/git/launcher/mirror_update'
|
4
4
|
require 'avm/launcher/instances/error'
|
5
5
|
require 'avm/git/vendor/github'
|
6
|
-
require 'avm/
|
6
|
+
require 'avm/git/launcher_stereotypes/git/publish'
|
7
7
|
|
8
8
|
module Avm
|
9
9
|
module Git
|
@@ -15,7 +15,7 @@ module Avm
|
|
15
15
|
class WarpBase < ::Avm::Launcher::Paths::Real
|
16
16
|
include ::EacRubyUtils::SimpleCache
|
17
17
|
|
18
|
-
TARGET_REMOTE = ::Avm::
|
18
|
+
TARGET_REMOTE = ::Avm::Git::LauncherStereotypes::Git::Publish::PUBLISH_GIT_REMOTE_NAME
|
19
19
|
|
20
20
|
def initialize(instance)
|
21
21
|
@instance = instance
|
@@ -3,8 +3,8 @@
|
|
3
3
|
require 'avm/git/launcher/warp_base'
|
4
4
|
|
5
5
|
module Avm
|
6
|
-
module
|
7
|
-
module
|
6
|
+
module Git
|
7
|
+
module LauncherStereotypes
|
8
8
|
class Git
|
9
9
|
class Warp < ::Avm::Git::Launcher::WarpBase
|
10
10
|
private
|
@@ -18,7 +18,7 @@ module Avm
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def source_remote_name
|
21
|
-
::Avm::
|
21
|
+
::Avm::Git::LauncherStereotypes::Git::Publish::PUBLISH_GIT_REMOTE_NAME
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -7,8 +7,8 @@ require 'avm/launcher/paths/real'
|
|
7
7
|
require 'avm/git/vendor/github'
|
8
8
|
|
9
9
|
module Avm
|
10
|
-
module
|
11
|
-
module
|
10
|
+
module Git
|
11
|
+
module LauncherStereotypes
|
12
12
|
class GitSubrepo
|
13
13
|
class Warp < ::Avm::Launcher::Paths::Real
|
14
14
|
include ::Avm::Git::Launcher::SubWarpBase
|
@@ -4,8 +4,8 @@ require 'avm/git/launcher/warp_base'
|
|
4
4
|
require 'avm/git/launcher/sub_warp_base'
|
5
5
|
|
6
6
|
module Avm
|
7
|
-
module
|
8
|
-
module
|
7
|
+
module Git
|
8
|
+
module LauncherStereotypes
|
9
9
|
class GitSubtree
|
10
10
|
class Warp < ::Avm::Git::Launcher::WarpBase
|
11
11
|
include ::Avm::Git::Launcher::SubWarpBase
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/launcher/stereotype'
|
4
|
-
require 'avm/
|
4
|
+
require 'avm/git/launcher_stereotypes/git'
|
5
5
|
require 'eac_ruby_utils/core_ext'
|
6
6
|
|
7
7
|
module Avm
|
8
|
-
module
|
9
|
-
module
|
8
|
+
module Git
|
9
|
+
module LauncherStereotypes
|
10
10
|
class GitSubtree
|
11
11
|
require_sub __FILE__
|
12
12
|
include Avm::Launcher::Stereotype
|
@@ -29,7 +29,7 @@ module Avm
|
|
29
29
|
def parent_git(parent_path)
|
30
30
|
return nil unless parent_path
|
31
31
|
|
32
|
-
if ::Avm::
|
32
|
+
if ::Avm::Git::LauncherStereotypes::Git.match?(parent_path)
|
33
33
|
parent_path
|
34
34
|
else
|
35
35
|
parent_git(parent_path.parent_path)
|
@@ -37,8 +37,8 @@ module Avm
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def other_git_stereotype?(path)
|
40
|
-
::Avm::
|
41
|
-
::Avm::
|
40
|
+
::Avm::Git::LauncherStereotypes::Git.match?(path) ||
|
41
|
+
::Avm::Git::LauncherStereotypes::GitSubrepo.match?(path)
|
42
42
|
end
|
43
43
|
|
44
44
|
def other_nogit_stereotype?(path)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/launcher_stereotypes/git'
|
4
|
+
require 'avm/git/launcher_stereotypes/git_subrepo'
|
5
|
+
require 'avm/git/launcher_stereotypes/git_subtree'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module Git
|
10
|
+
module LauncherStereotypes
|
11
|
+
class Provider
|
12
|
+
STEREOTYPES = [::Avm::Git::LauncherStereotypes::Git,
|
13
|
+
::Avm::Git::LauncherStereotypes::GitSubrepo,
|
14
|
+
::Avm::Git::LauncherStereotypes::GitSubtree].freeze
|
15
|
+
|
16
|
+
def all
|
17
|
+
STEREOTYPES
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/sub/{avm-tools/spec/lib/avm/launcher/git → avm-git/spec/lib/avm/git/launcher}/base_spec.rb
RENAMED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'avm/git/launcher/base'
|
4
4
|
|
5
5
|
RSpec.describe ::Avm::Git::Launcher::Base do
|
6
|
-
context 'new non-bare repository' do
|
6
|
+
context 'new non-bare repository' do # rubocop:disable RSpec/ContextWording
|
7
7
|
let(:repo) do
|
8
8
|
r = described_class.new(::Dir.mktmpdir)
|
9
9
|
r.git
|
@@ -13,12 +13,12 @@ RSpec.describe ::Avm::Git::Launcher::Base do
|
|
13
13
|
describe '#remote_exist?' do
|
14
14
|
it { expect(repo.remote_exist?('origin')).to eq(false) }
|
15
15
|
|
16
|
-
context 'after remote added' do
|
16
|
+
context 'after remote added' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
|
17
17
|
before { repo.execute!('remote', 'add', 'origin', 'file:///path/to/remote') }
|
18
18
|
|
19
19
|
it { expect(repo.remote_exist?('origin')).to eq(true) }
|
20
20
|
|
21
|
-
context 'after remote removed' do
|
21
|
+
context 'after remote removed' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
|
22
22
|
before { repo.execute!('remote', 'remove', 'origin') }
|
23
23
|
|
24
24
|
it { expect(repo.remote_exist?('origin')).to eq(false) }
|
@@ -29,12 +29,12 @@ RSpec.describe ::Avm::Git::Launcher::Base do
|
|
29
29
|
describe '#assert_remote_url' do
|
30
30
|
it { expect(repo.remote_exist?('origin')).to eq(false) }
|
31
31
|
|
32
|
-
context 'after asserted remote URL "/remote1"' do
|
32
|
+
context 'after asserted remote URL "/remote1"' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
|
33
33
|
before { repo.assert_remote_url('origin', '/remote1') }
|
34
34
|
|
35
35
|
it { expect(repo.git.remote('origin').url).to eq('/remote1') }
|
36
36
|
|
37
|
-
context 'after asserted remote URL "/remote2"' do
|
37
|
+
context 'after asserted remote URL "/remote2"' do # rubocop:disable RSpec/ContextWording, RSpec/NestedGroups:
|
38
38
|
before { repo.assert_remote_url('origin', '/remote2') }
|
39
39
|
|
40
40
|
it { expect(repo.git.remote('origin').url).to eq('/remote2') }
|
@@ -15,14 +15,14 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
16
16
|
|
17
17
|
s.add_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.3'
|
18
|
-
s.add_dependency 'avm', '~> 0.
|
19
|
-
s.add_dependency 'avm-eac_ruby_base1', '~> 0.
|
18
|
+
s.add_dependency 'avm', '~> 0.50'
|
19
|
+
s.add_dependency 'avm-eac_ruby_base1', '~> 0.25'
|
20
20
|
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
|
21
21
|
s.add_dependency 'avm-files', '~> 0.4', '>= 0.4.1'
|
22
|
-
s.add_dependency 'avm-git', '~> 0.
|
22
|
+
s.add_dependency 'avm-git', '~> 0.8'
|
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.
|
25
|
+
s.add_dependency 'eac_git', '~> 0.13'
|
26
26
|
s.add_dependency 'eac_ruby_base0', '~> 0.17'
|
27
27
|
s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
|
28
28
|
s.add_dependency 'git', '~> 1.12'
|
@@ -1,5 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/git/launcher_stereotypes/git'
|
4
|
+
require 'avm/git/launcher_stereotypes/git_subrepo'
|
5
|
+
require 'avm/git/launcher_stereotypes/git_subtree'
|
6
|
+
require 'avm/eac_ruby_base1/launcher_stereotypes/base'
|
3
7
|
require 'eac_ruby_utils/core_ext'
|
4
8
|
|
5
9
|
module Avm
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/launcher/stereotype'
|
4
|
+
require 'avm/projects/stereotypes'
|
5
|
+
require 'avm/tools/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Tools
|
9
|
+
class Runner
|
10
|
+
class LauncherStereotypes
|
11
|
+
class List
|
12
|
+
runner_with :help, :output do
|
13
|
+
bool_opt '-d', '--deprecated'
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
infov 'Found', stereotypes.count
|
18
|
+
run_output
|
19
|
+
end
|
20
|
+
|
21
|
+
def output_content
|
22
|
+
stereotypes.map { |s| "#{s}\n" }.join
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def stereotypes
|
28
|
+
(parsed.deprecated? ? deprecated_stereotypes : registry_stereotypes)
|
29
|
+
end
|
30
|
+
|
31
|
+
def registry_stereotypes
|
32
|
+
::Avm::Registry.launcher_stereotypes.available.sort_by { |s| [s.name] }
|
33
|
+
end
|
34
|
+
|
35
|
+
def deprecated_stereotypes
|
36
|
+
::Avm::Launcher::Stereotype.stereotypes.sort_by { |s| [s.stereotype_name] }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -48,7 +48,7 @@ RSpec.describe ::Avm::Launcher::Context do
|
|
48
48
|
.each { |s| expect(sub.stereotypes).not_to include(s) }
|
49
49
|
end
|
50
50
|
it { expect(instance).to be_a(::Avm::Launcher::Instances::Base) }
|
51
|
-
it { expect(instance.stereotypes).to include(::Avm::
|
51
|
+
it { expect(instance.stereotypes).to include(::Avm::Git::LauncherStereotypes::GitSubrepo) }
|
52
52
|
end
|
53
53
|
|
54
54
|
context 'when sub is a GitSubtree' do
|
@@ -68,7 +68,7 @@ RSpec.describe ::Avm::Launcher::Context do
|
|
68
68
|
.each { |s| expect(sub.stereotypes).not_to include(s) }
|
69
69
|
end
|
70
70
|
it { expect(instance).to be_a(::Avm::Launcher::Instances::Base) }
|
71
|
-
it { expect(instance.stereotypes).to include(::Avm::
|
71
|
+
it { expect(instance.stereotypes).to include(::Avm::Git::LauncherStereotypes::GitSubtree) }
|
72
72
|
end
|
73
73
|
|
74
74
|
context 'subtree present' do
|
@@ -82,7 +82,7 @@ RSpec.describe ::Avm::Launcher::Context do
|
|
82
82
|
it 'recognizes subtree instance' do
|
83
83
|
i = described_class.current.instance('/subtree_main_app/mylib')
|
84
84
|
expect(i).to be_a(::Avm::Launcher::Instances::Base)
|
85
|
-
expect(i.stereotypes).to include(::Avm::
|
85
|
+
expect(i.stereotypes).to include(::Avm::Git::LauncherStereotypes::GitSubtree)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/git/launcher_stereotypes/git_subrepo/publish'
|
4
4
|
require 'avm/launcher/publish/check_result'
|
5
5
|
|
6
|
-
RSpec.describe Avm::
|
6
|
+
RSpec.describe Avm::Git::LauncherStereotypes::GitSubrepo::Publish do
|
7
7
|
describe '#check' do
|
8
8
|
context 'on clean context' do
|
9
9
|
let(:settings_path) { ::File.join(__dir__, 'publish_spec_settings.yml') }
|
@@ -63,7 +63,7 @@ RSpec.describe Avm::Projects::Stereotypes::GitSubrepo::Publish do
|
|
63
63
|
def check_publish_status(status_key)
|
64
64
|
instance = app_mylib_instance
|
65
65
|
expect(instance).to be_a(::Avm::Launcher::Instances::Base)
|
66
|
-
expect(instance.stereotypes).to include(::Avm::
|
66
|
+
expect(instance.stereotypes).to include(::Avm::Git::LauncherStereotypes::GitSubrepo)
|
67
67
|
|
68
68
|
status = ::Avm::Launcher::Publish::CheckResult.const_get("STATUS_#{status_key}".upcase)
|
69
69
|
publish = described_class.new(instance)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/git/launcher_stereotypes/git_subrepo/warp'
|
4
4
|
|
5
|
-
RSpec.describe Avm::
|
5
|
+
RSpec.describe Avm::Git::LauncherStereotypes::GitSubrepo::Warp do
|
6
6
|
describe '#unknown' do
|
7
7
|
before do
|
8
8
|
temp_context(::File.join(__dir__, 'warp_spec_settings.yml'))
|
@@ -41,7 +41,7 @@ RSpec.describe Avm::Projects::Stereotypes::GitSubrepo::Warp do
|
|
41
41
|
instance = ::Avm::Launcher::Context.current.instance('/app1/mylib')
|
42
42
|
expect(instance).to be_a ::Avm::Launcher::Instances::Base
|
43
43
|
warp = instance.warped
|
44
|
-
expect(warp).to be_a ::Avm::
|
44
|
+
expect(warp).to be_a ::Avm::Git::LauncherStereotypes::GitSubrepo::Warp
|
45
45
|
wgit = ::Avm::Git::Launcher::Base.new(warp)
|
46
46
|
expect(wgit.rev_parse('HEAD')).to eq master_ref_previous
|
47
47
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/tools/runner'
|
4
|
+
|
5
|
+
::RSpec.describe ::Avm::Tools::Runner::LauncherStereotypes::List do
|
6
|
+
def avm_tools_runner_args_prefix
|
7
|
+
%w[launcher-stereotypes list]
|
8
|
+
end
|
9
|
+
|
10
|
+
it do
|
11
|
+
expect { avm_tools_runner_run }.not_to raise_error
|
12
|
+
end
|
13
|
+
|
14
|
+
it do
|
15
|
+
expect { avm_tools_runner_run('--deprecated') }.not_to raise_error
|
16
|
+
end
|
17
|
+
end
|
data/sub/eac_git/eac_git.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,vendor}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
15
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.105'
|
16
16
|
s.add_dependency 'parseconfig', '~> 1.1', '>= 1.1.2'
|
17
17
|
|
18
18
|
s.add_development_dependency 'aranha-parsers', '~> 0.8', '>= 0.8.2'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_git/
|
3
|
+
require 'eac_git/remote_like'
|
4
4
|
require 'eac_ruby_utils/core_ext'
|
5
5
|
|
6
6
|
module EacGit
|
@@ -9,6 +9,7 @@ module EacGit
|
|
9
9
|
NO_SUCH_REMOTE_CODE = 128
|
10
10
|
|
11
11
|
enable_simple_cache
|
12
|
+
include ::EacGit::RemoteLike
|
12
13
|
|
13
14
|
common_constructor :local, :name
|
14
15
|
|
@@ -16,6 +17,16 @@ module EacGit
|
|
16
17
|
url
|
17
18
|
end
|
18
19
|
|
20
|
+
# @return [EacRubyUtils::Envs::Command
|
21
|
+
def git_command(*args)
|
22
|
+
local.command(*args)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [String]
|
26
|
+
def remote_reference
|
27
|
+
name
|
28
|
+
end
|
29
|
+
|
19
30
|
# @return [String, nil]
|
20
31
|
def url
|
21
32
|
local.command('remote', 'get-url', name)
|