avm-tools 0.140.0 → 0.141.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/projects/stereotypes/git/publish.rb +2 -2
  3. data/lib/avm/projects/stereotypes/git/warp.rb +2 -2
  4. data/lib/avm/projects/stereotypes/git.rb +2 -2
  5. data/lib/avm/projects/stereotypes/git_subrepo/publish.rb +2 -2
  6. data/lib/avm/projects/stereotypes/git_subrepo/warp.rb +7 -7
  7. data/lib/avm/projects/stereotypes/git_subrepo.rb +4 -4
  8. data/lib/avm/projects/stereotypes/git_subtree/publish.rb +2 -2
  9. data/lib/avm/projects/stereotypes/git_subtree/warp.rb +4 -4
  10. data/lib/avm/projects/stereotypes/git_subtree.rb +3 -3
  11. data/lib/avm/projects/stereotypes/ruby_gem/publish.rb +2 -2
  12. data/lib/avm/projects/stereotypes/ruby_gem.rb +4 -4
  13. data/lib/avm/tools/runner/files/format.rb +2 -2
  14. data/lib/avm/tools/runner/git/commit.rb +2 -2
  15. data/lib/avm/tools/runner/git/deploy.rb +2 -2
  16. data/lib/avm/tools/runner/git.rb +2 -2
  17. data/lib/avm/tools/version.rb +1 -1
  18. metadata +7 -25
  19. data/lib/avm/launcher/git/base/class_methods.rb +0 -28
  20. data/lib/avm/launcher/git/base/dirty_files.rb +0 -23
  21. data/lib/avm/launcher/git/base/remotes.rb +0 -40
  22. data/lib/avm/launcher/git/base/subrepo.rb +0 -44
  23. data/lib/avm/launcher/git/base/underlying.rb +0 -63
  24. data/lib/avm/launcher/git/base.rb +0 -86
  25. data/lib/avm/launcher/git/error.rb +0 -13
  26. data/lib/avm/launcher/git/mirror_update.rb +0 -38
  27. data/lib/avm/launcher/git/publish_base.rb +0 -125
  28. data/lib/avm/launcher/git/remote.rb +0 -55
  29. data/lib/avm/launcher/git/sub_warp_base.rb +0 -33
  30. data/lib/avm/launcher/git/warp_base.rb +0 -67
  31. data/lib/avm/launcher/git.rb +0 -7
  32. data/lib/avm/launcher/ruby/gem/build.rb +0 -125
  33. data/lib/avm/launcher/ruby/gem/specification.rb +0 -63
  34. data/lib/avm/launcher/ruby/gem.rb +0 -4
  35. data/lib/avm/launcher/ruby.rb +0 -3
  36. data/lib/avm/projects/stereotype.rb +0 -63
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed2d914555d3c58362e1295400822e92705cae0150e957fd451d9bb88605bf52
4
- data.tar.gz: 0fa211ad333f697fc6c07bb89205552f64e5be5730795e5828cb6b652eef500b
3
+ metadata.gz: 60fac08c348fc622fef6058a07454042e877f79bb1905c53af18821cd0bc3b06
4
+ data.tar.gz: 81072003eb8144896fe1cc263a4fd090c6ee0532c8fb15066dcbdfdb5137ef05
5
5
  SHA512:
6
- metadata.gz: 153e38b2a7f25f90736f65388c2cdc61a011aefeee2247fdd94f0165624af5dc73b78cb7a7d31a39bec85e37712ec745b80eca5ac36f7eb2bd7a3aa129860af0
7
- data.tar.gz: bf4e32eaf0b13d24215b29fde58b9d0dc44335050fad19ab86d6f970312d260ea63b6244e70372ccb72ada83e199bdf4d69ae2acb96c220090a4e6f3952821b8
6
+ metadata.gz: d5bac08c0ad7cba5a5dcbde799f8d520a991edb1e5111771627556a5b5745a22d68f62698b8dd9fb4cf30487d0032da377e232c5ce9c0737af4d8a92ec47b1c7
7
+ data.tar.gz: 8401554316ce6e960953bc677ac69a82b145439c306726a036c16cd9ff6f6273d8448b5867d7c303b9552ff3e4cf3a57f291f6ca0eb4a9dadbd4e4bcc27968ed
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/publish_base'
3
+ require 'avm/git/launcher/publish_base'
4
4
 
5
5
  module Avm
6
6
  module Projects
7
7
  module Stereotypes
8
8
  class Git
9
- class Publish < ::Avm::Launcher::Git::PublishBase
9
+ class Publish < ::Avm::Git::Launcher::PublishBase
10
10
  PUBLISH_GIT_REMOTE_NAME = 'publish'
11
11
  end
12
12
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/warp_base'
3
+ require 'avm/git/launcher/warp_base'
4
4
 
5
5
  module Avm
6
6
  module Projects
7
7
  module Stereotypes
8
8
  class Git
9
- class Warp < ::Avm::Launcher::Git::WarpBase
9
+ class Warp < ::Avm::Git::Launcher::WarpBase
10
10
  private
11
11
 
12
12
  def current_ref
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/projects/stereotype'
3
+ require 'avm/launcher/stereotype'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
 
6
6
  module Avm
@@ -8,7 +8,7 @@ module Avm
8
8
  module Stereotypes
9
9
  class Git
10
10
  require_sub __FILE__
11
- include Avm::Projects::Stereotype
11
+ include Avm::Launcher::Stereotype
12
12
 
13
13
  class << self
14
14
  def match?(path)
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/publish_base'
3
+ require 'avm/git/launcher/publish_base'
4
4
 
5
5
  module Avm
6
6
  module Projects
7
7
  module Stereotypes
8
8
  class GitSubrepo
9
- class Publish < ::Avm::Launcher::Git::PublishBase
9
+ class Publish < ::Avm::Git::Launcher::PublishBase
10
10
  end
11
11
  end
12
12
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/simple_cache'
4
- require 'avm/launcher/git/sub_warp_base'
4
+ require 'avm/git/launcher/sub_warp_base'
5
5
  require 'avm/launcher/errors/base'
6
6
  require 'avm/launcher/paths/real'
7
7
  require 'avm/git/vendor/github'
@@ -11,7 +11,7 @@ module Avm
11
11
  module Stereotypes
12
12
  class GitSubrepo
13
13
  class Warp < ::Avm::Launcher::Paths::Real
14
- include ::Avm::Launcher::Git::SubWarpBase
14
+ include ::Avm::Git::Launcher::SubWarpBase
15
15
  include ::EacRubyUtils::SimpleCache
16
16
 
17
17
  attr_reader :instance
@@ -46,11 +46,11 @@ module Avm
46
46
  end
47
47
 
48
48
  def init_aux
49
- ::Avm::Launcher::Git::Base.new(aux_path).init_bare
49
+ ::Avm::Git::Launcher::Base.new(aux_path).init_bare
50
50
  end
51
51
 
52
52
  def parent_git_warped_uncached
53
- ::Avm::Launcher::Git::Base.new(parent_instance.warped)
53
+ ::Avm::Git::Launcher::Base.new(parent_instance.warped)
54
54
  end
55
55
 
56
56
  def aux_path
@@ -58,7 +58,7 @@ module Avm
58
58
  end
59
59
 
60
60
  def warped_git_uncached
61
- ::Avm::Launcher::Git::Base.new(instance.cache_path('git_repository'))
61
+ ::Avm::Git::Launcher::Base.new(instance.cache_path('git_repository'))
62
62
  end
63
63
 
64
64
  def push_to_aux
@@ -68,11 +68,11 @@ module Avm
68
68
  end
69
69
 
70
70
  def reset
71
- ::Avm::Launcher::Git::MirrorUpdate.new(warped_git, aux_path, 'master')
71
+ ::Avm::Git::Launcher::MirrorUpdate.new(warped_git, aux_path, 'master')
72
72
  end
73
73
 
74
74
  def assert_target_remote
75
- warped_git.assert_remote_url(::Avm::Launcher::Git::WarpBase::TARGET_REMOTE,
75
+ warped_git.assert_remote_url(::Avm::Git::Launcher::WarpBase::TARGET_REMOTE,
76
76
  target_remote_url)
77
77
  end
78
78
 
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/error'
3
+ require 'avm/git/launcher/error'
4
4
  require 'eac_ruby_utils/core_ext'
5
- require 'avm/projects/stereotype'
5
+ require 'avm/launcher/stereotype'
6
6
 
7
7
  module Avm
8
8
  module Projects
9
9
  module Stereotypes
10
10
  class GitSubrepo
11
11
  require_sub __FILE__
12
- include Avm::Projects::Stereotype
12
+ include Avm::Launcher::Stereotype
13
13
 
14
14
  class << self
15
15
  def match?(path)
@@ -25,7 +25,7 @@ module Avm
25
25
  m = /remote\s*=\s(.+)/.match(l)
26
26
  return m[1] if m
27
27
  end
28
- raise ::Avm::Launcher::Git::Error.new(path, '"remote = ... " not found')
28
+ raise ::Avm::Git::Launcher::Error.new(path, '"remote = ... " not found')
29
29
  end
30
30
  end
31
31
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/publish_base'
3
+ require 'avm/git/launcher/publish_base'
4
4
 
5
5
  module Avm
6
6
  module Projects
7
7
  module Stereotypes
8
8
  class GitSubtree
9
- class Publish < ::Avm::Launcher::Git::PublishBase
9
+ class Publish < ::Avm::Git::Launcher::PublishBase
10
10
  end
11
11
  end
12
12
  end
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/warp_base'
4
- require 'avm/launcher/git/sub_warp_base'
3
+ require 'avm/git/launcher/warp_base'
4
+ require 'avm/git/launcher/sub_warp_base'
5
5
 
6
6
  module Avm
7
7
  module Projects
8
8
  module Stereotypes
9
9
  class GitSubtree
10
- class Warp < ::Avm::Launcher::Git::WarpBase
11
- include ::Avm::Launcher::Git::SubWarpBase
10
+ class Warp < ::Avm::Git::Launcher::WarpBase
11
+ include ::Avm::Git::Launcher::SubWarpBase
12
12
 
13
13
  private
14
14
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/projects/stereotype'
3
+ require 'avm/launcher/stereotype'
4
4
  require 'avm/projects/stereotypes/git'
5
5
  require 'eac_ruby_utils/core_ext'
6
6
 
@@ -9,7 +9,7 @@ module Avm
9
9
  module Stereotypes
10
10
  class GitSubtree
11
11
  require_sub __FILE__
12
- include Avm::Projects::Stereotype
12
+ include Avm::Launcher::Stereotype
13
13
 
14
14
  class << self
15
15
  def match?(path)
@@ -42,7 +42,7 @@ module Avm
42
42
  end
43
43
 
44
44
  def other_nogit_stereotype?(path)
45
- Avm::Projects::Stereotype.nogit_stereotypes.any? { |s| s.match?(path) }
45
+ Avm::Launcher::Stereotype.nogit_stereotypes.any? { |s| s.match?(path) }
46
46
  end
47
47
  end
48
48
  end
@@ -7,7 +7,7 @@ require 'rubygems'
7
7
  require 'eac_cli/speaker'
8
8
  require 'avm/launcher/publish/base'
9
9
  require 'avm/launcher/publish/check_result'
10
- require 'avm/launcher/ruby/gem'
10
+ require 'avm/eac_ruby_base1/launcher/gem'
11
11
 
12
12
  module Avm
13
13
  module Projects
@@ -71,7 +71,7 @@ module Avm
71
71
  end
72
72
 
73
73
  def gem_build_uncached
74
- ::Avm::Launcher::Ruby::Gem::Build.new(source)
74
+ ::Avm::EacRubyBase1::Launcher::Gem::Build.new(source)
75
75
  end
76
76
 
77
77
  def publish
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/projects/stereotype'
4
- require 'avm/launcher/ruby/gem/specification'
3
+ require 'avm/eac_ruby_base1/launcher/gem/specification'
4
+ require 'avm/launcher/stereotype'
5
5
  require 'eac_ruby_utils/core_ext'
6
6
 
7
7
  module Avm
@@ -9,7 +9,7 @@ module Avm
9
9
  module Stereotypes
10
10
  class RubyGem
11
11
  require_sub __FILE__
12
- include Avm::Projects::Stereotype
12
+ include Avm::Launcher::Stereotype
13
13
 
14
14
  class << self
15
15
  def match?(path)
@@ -21,7 +21,7 @@ module Avm
21
21
  end
22
22
 
23
23
  def load_gemspec(gemspec_file)
24
- ::Avm::Launcher::Ruby::Gem::Specification.new(gemspec_file)
24
+ ::Avm::EacRubyBase1::Launcher::Gem::Specification.new(gemspec_file)
25
25
  end
26
26
  end
27
27
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'avm/files/formatter'
4
4
  require 'eac_cli/core_ext'
5
- require 'avm/launcher/git/base'
5
+ require 'avm/git/launcher/base'
6
6
 
7
7
  module Avm
8
8
  module Tools
@@ -29,7 +29,7 @@ module Avm
29
29
  end
30
30
 
31
31
  def git
32
- @git ||= ::Avm::Launcher::Git::Base.new('.')
32
+ @git ||= ::Avm::Git::Launcher::Base.new('.')
33
33
  end
34
34
 
35
35
  def git_dirty_files
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'eac_cli/speaker'
4
4
  require 'eac_ruby_utils/simple_cache'
5
- require 'avm/launcher/git/base'
5
+ require 'avm/git/launcher/base'
6
6
  require 'filesize'
7
7
  require 'avm/git/commit'
8
8
 
@@ -76,7 +76,7 @@ module Avm
76
76
  end
77
77
 
78
78
  def git_uncached
79
- ::Avm::Launcher::Git::Base.new(runner_context.call(:repository_path))
79
+ ::Avm::Git::Launcher::Base.new(runner_context.call(:repository_path))
80
80
  end
81
81
 
82
82
  def commit_uncached
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/base'
3
+ require 'avm/git/launcher/base'
4
4
  require 'avm/git/commit'
5
5
  require 'eac_config/node'
6
6
 
@@ -57,7 +57,7 @@ module Avm
57
57
  end
58
58
 
59
59
  def git_uncached
60
- ::Avm::Launcher::Git::Base.new(git_repository_path)
60
+ ::Avm::Git::Launcher::Base.new(git_repository_path)
61
61
  end
62
62
 
63
63
  def git_repository_path
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/tools/core_ext'
4
- require 'avm/launcher/git/base'
4
+ require 'avm/git/launcher/base'
5
5
 
6
6
  module Avm
7
7
  module Tools
@@ -23,7 +23,7 @@ module Avm
23
23
  end
24
24
 
25
25
  def git
26
- @git ||= ::Avm::Launcher::Git::Base.by_root(repository_path)
26
+ @git ||= ::Avm::Git::Launcher::Base.by_root(repository_path)
27
27
  end
28
28
 
29
29
  # @return [[EacGit::Local]]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.140.0'
5
+ VERSION = '0.141.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.140.0
4
+ version: 0.141.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
@@ -36,28 +36,28 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.46'
39
+ version: '0.48'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.46'
46
+ version: '0.48'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: avm-eac_ruby_base1
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.22'
53
+ version: '0.23'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.22'
60
+ version: '0.23'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: avm-eac_ubuntu_base0
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +98,14 @@ dependencies:
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '0.5'
101
+ version: '0.6'
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '0.5'
108
+ version: '0.6'
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: clipboard
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -252,25 +252,7 @@ files:
252
252
  - Gemfile
253
253
  - exe/avm
254
254
  - lib/avm.rb
255
- - lib/avm/launcher/git.rb
256
- - lib/avm/launcher/git/base.rb
257
- - lib/avm/launcher/git/base/class_methods.rb
258
- - lib/avm/launcher/git/base/dirty_files.rb
259
- - lib/avm/launcher/git/base/remotes.rb
260
- - lib/avm/launcher/git/base/subrepo.rb
261
- - lib/avm/launcher/git/base/underlying.rb
262
- - lib/avm/launcher/git/error.rb
263
- - lib/avm/launcher/git/mirror_update.rb
264
- - lib/avm/launcher/git/publish_base.rb
265
- - lib/avm/launcher/git/remote.rb
266
- - lib/avm/launcher/git/sub_warp_base.rb
267
- - lib/avm/launcher/git/warp_base.rb
268
- - lib/avm/launcher/ruby.rb
269
- - lib/avm/launcher/ruby/gem.rb
270
- - lib/avm/launcher/ruby/gem/build.rb
271
- - lib/avm/launcher/ruby/gem/specification.rb
272
255
  - lib/avm/projects.rb
273
- - lib/avm/projects/stereotype.rb
274
256
  - lib/avm/projects/stereotypes.rb
275
257
  - lib/avm/projects/stereotypes/git.rb
276
258
  - lib/avm/projects/stereotypes/git/local_project_mixin.rb
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Launcher
5
- module Git
6
- class Base < ::Avm::Launcher::Paths::Real
7
- module ClassMethods
8
- # @return [Avm::Launcher::Git::Base]
9
- def by_root(search_base_path)
10
- new(find_root(search_base_path).to_path)
11
- end
12
-
13
- # Searches the root path for the Git repository which includes +search_base_path+.
14
- # @return [Pathname]
15
- def find_root(search_base_path)
16
- path = search_base_path.to_pathname.expand_path
17
- loop do
18
- return path if path.join('.git').exist?
19
- raise "\".git\" not found for \"#{search_base_path}\"" if path.parent.root?
20
-
21
- path = path.parent
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'active_support/core_ext/object'
4
-
5
- module Avm
6
- module Launcher
7
- module Git
8
- class Base < ::Avm::Launcher::Paths::Real
9
- module DirtyFiles
10
- delegate :dirty?, to: :eac_git
11
-
12
- def dirty_files
13
- eac_git.dirty_files.map do |df|
14
- ::OpenStruct.new(
15
- df.to_h.merge(path: df.path.to_path, absolute_path: df.absolute_path.to_path)
16
- )
17
- end
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/launcher/git/remote'
5
-
6
- module Avm
7
- module Launcher
8
- module Git
9
- class Base < ::Avm::Launcher::Paths::Real
10
- module Remotes
11
- # @return [Avm::Launcher::Git::Remote]
12
- def remote(name)
13
- ::Avm::Launcher::Git::Remote.new(self, name)
14
- end
15
-
16
- def remote_hashs(remote_name)
17
- remote(remote_name).ls
18
- end
19
-
20
- def remote_exist?(remote_name)
21
- remote(remote_name).exist?
22
- end
23
-
24
- def assert_remote_url(remote_name, url)
25
- r = git.remote(remote_name)
26
- if !r.url || r.url != url
27
- r.remove if r.url
28
- git.add_remote(remote_name, url)
29
- end
30
- r
31
- end
32
-
33
- def remote_branch_sha(remote_name, branch_name)
34
- remote_hashs(remote_name)["refs/heads/#{branch_name}"]
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'active_support/core_ext/object'
4
-
5
- module Avm
6
- module Launcher
7
- module Git
8
- class Base < ::Avm::Launcher::Paths::Real
9
- module Subrepo
10
- def subrepo_status(subrepo_path)
11
- s = execute!('subrepo', 'status', subrepo_path.gsub(%r{\A/}, ''))
12
- raise s.strip.to_s if s.include?('is not a subrepo')
13
-
14
- r = subrepo_status_parse_output(s)
15
- raise "Empty subrepo status for |#{s}|\n" unless r.any?
16
-
17
- r
18
- end
19
-
20
- def subrepo_remote_url(subrepo_path)
21
- h = subrepo_status(subrepo_path)
22
- url = h['Remote URL']
23
- return url if url.present?
24
-
25
- raise "Remote URL is blank for subrepo \"#{subrepo_path}\" (Subrepo status: #{h})"
26
- end
27
-
28
- private
29
-
30
- def subrepo_status_parse_output(output)
31
- r = {}.with_indifferent_access
32
- output.each_line do |l|
33
- m = /\A([^\:]+)\:(.*)\z/.match(l.strip)
34
- next unless m && m[2].present?
35
-
36
- r[m[1].strip] = m[2].strip
37
- end
38
- r
39
- end
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_git/executables'
4
- require 'eac_ruby_utils/envs'
5
- require 'git'
6
- require 'avm/launcher/paths/real'
7
-
8
- module Avm
9
- module Launcher
10
- module Git
11
- class Base < ::Avm::Launcher::Paths::Real
12
- module Underlying
13
- def command(*args)
14
- args, options = build_args(args)
15
- r = ::EacGit::Executables.git.command(*args)
16
- (options[:exit_outputs] || {}).each do |status_code, result|
17
- r = r.status_result(status_code, result)
18
- end
19
- r
20
- end
21
-
22
- def execute(*args)
23
- command(*args).execute
24
- end
25
-
26
- def execute!(*args)
27
- command(*args).execute!
28
- end
29
-
30
- def system!(*args)
31
- command(*args).system!
32
- end
33
-
34
- def init
35
- git
36
- self
37
- end
38
-
39
- private
40
-
41
- def build_args(args)
42
- options = {}
43
- if args.last.is_a?(Hash)
44
- options = args.last
45
- args.pop
46
- end
47
- args = args.first if args.first.is_a?(Array)
48
- [['-C', self, '--no-pager'] + args, options]
49
- end
50
-
51
- def git_uncached
52
- FileUtils.mkdir_p(self)
53
- if File.exist?(subpath('.git'))
54
- ::Git.open(self)
55
- else
56
- ::Git.init(self)
57
- end
58
- end
59
- end
60
- end
61
- end
62
- end
63
- end