eac_git 0.12.3 → 0.13.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 748e8547b254bda18faae0b675f1a470c67226a146d4df97a6e6a6debadbaca3
4
- data.tar.gz: 4f1728d62f01dea84ce25b74a98724b44fac1e42a10961ff804a92c817f02139
3
+ metadata.gz: ad179bd7d0768619cf0b8ec1dd226926fb7727448bd2d55d7502bff1e81040f9
4
+ data.tar.gz: fdde3d525de0c562555a6838e1ef83fde137350003e5fa2697e3f26220349656
5
5
  SHA512:
6
- metadata.gz: 59a339ea11b4c0eab4ae782bc4e5ff5d638f93bb73503e5c2d34e7c32542298848541eb7a7fedfea0dda64806655be75461fcdf6ea91f173a17a1a8680c6b0c1
7
- data.tar.gz: c534fdf799cfd8b166f5e3e043619179b6000568c6957aba8f13a7e72c0c663845bf4cda1f6052e2bf61b8f7c7a112626203d8aefd750b427542d40d9d76fbf3
6
+ metadata.gz: 9b3ce069a038c6db5e8f58cb9a8dfa7362685d5bdd8cf3722a84f097ca06a7730199f4422011f2e710e025ee991a2523f2fbd42abd84ed34429ea3003782d1cc
7
+ data.tar.gz: ff51e5148857b89adfd02d205703b30cf16656543cf569918859af89b43f159dce964a30c6d8abfd4a1e095d3d28131a918608523c255c2207a70b284c02e1bc
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_git/remote'
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)
@@ -1,19 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_git/executables'
4
+ require 'eac_git/remote_like'
4
5
  require 'eac_ruby_utils/core_ext'
5
6
 
6
7
  module EacGit
7
8
  # A Git remote repository referenced by URI.
8
9
  class Remote
9
- require_sub __FILE__
10
+ include ::EacGit::RemoteLike
10
11
 
11
12
  common_constructor :uri
12
13
 
13
- def ls
14
- ::EacGit::Remote::LsResult.by_ls_remote_command_output(
15
- ::EacGit::Executables.git.command('ls-remote', uri).execute!
16
- )
14
+ # @return [EacRubyUtils::Envs::Command
15
+ def git_command(*args, &block)
16
+ ::EacGit::Executables.git.command(*args, &block)
17
+ end
18
+
19
+ # @return [String]
20
+ def remote_reference
21
+ uri
17
22
  end
18
23
  end
19
24
  end
@@ -3,7 +3,7 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacGit
6
- class Remote
6
+ module RemoteLike
7
7
  class LsResult
8
8
  class << self
9
9
  def by_ls_remote_command_output(output)
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacGit
6
+ module RemoteLike
7
+ require_sub __FILE__
8
+ enable_abstract_methods
9
+
10
+ # @return [String] The output of command "git fetch".
11
+ def fetch
12
+ local.command('fetch', name).execute!
13
+ end
14
+
15
+ # @return [EacRubyUtils::Envs::Command
16
+ def git_command(*_args)
17
+ raise_abstract_method __method__
18
+ end
19
+
20
+ # @return [EacGit::RemoteLike::LsResult]
21
+ def ls
22
+ ::EacGit::RemoteLike::LsResult.by_ls_remote_command_output(
23
+ git_command('ls-remote', remote_reference).execute!
24
+ )
25
+ end
26
+
27
+ # @return [String]
28
+ def remote_reference
29
+ raise_abstract_method __method__
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacGit
4
- VERSION = '0.12.3'
4
+ VERSION = '0.13.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-30 00:00:00.000000000 Z
11
+ date: 2022-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.103'
19
+ version: '0.105'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.103'
26
+ version: '0.105'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: parseconfig
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +99,8 @@ files:
99
99
  - lib/eac_git/local/subrepo.rb
100
100
  - lib/eac_git/local/subrepo/config.rb
101
101
  - lib/eac_git/remote.rb
102
- - lib/eac_git/remote/ls_result.rb
102
+ - lib/eac_git/remote_like.rb
103
+ - lib/eac_git/remote_like/ls_result.rb
103
104
  - lib/eac_git/rspec.rb
104
105
  - lib/eac_git/rspec/setup.rb
105
106
  - lib/eac_git/rspec/stubbed_git_local_repo.rb