eac_git 0.15.0 → 0.17.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: 3fe4d94f7db9bca8bb4b528a63f88d5468814df46f29964ba93583f8f250356b
4
- data.tar.gz: a546176555f4ecc7b3a0ddac7d13ad6d69346158c3a834c4d8c255955de1a0a8
3
+ metadata.gz: 2ec8481bbfe574a9c00ed4324f402a56379b37820d4c6bb3f97fe8ffcdc3d6c1
4
+ data.tar.gz: 76d42a04d49ab572c5b1ccd370d4b9996d1e67eba2c4f86f36ed603005d27d34
5
5
  SHA512:
6
- metadata.gz: a2d29cfc5cc2bae11893f7abab005d796e309ff3572e4d44d708c0d45f71214deae8b256eb480b5c96c283d395d9c402f6614f2e83b6a42d4fd119b7aeaa6d7d
7
- data.tar.gz: 6d30cbad563fe641196afefb77602b96de464c736eea5cb295c8209e5fdc106f98bb594ac51be06ad971cfd51ec94b23da28ba3cbdd3b0e6730f07dad2df0a96
6
+ metadata.gz: 06f7fce3e78470c6c8f59ac09563ff0e9ffac80256beb5914b0172901ffedbeacad6af7b51fa6a67cd75550e5e289630985f38daf22733e8fd4a34f797868858
7
+ data.tar.gz: c8797bbcd1b8c3e5e1eb72a20b8c16e928f092db763c5369860b78016b9e8d0e82dd89d75b33b1c0a397c321769ec844f1d147720ef4f5f0c3d008101219f387
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_ruby_utils/envs'
3
+ require 'eac_ruby_utils'
5
4
 
6
5
  module EacGit
7
6
  module Executables
@@ -26,7 +25,7 @@ module EacGit
26
25
 
27
26
  module GitCommandExtensions
28
27
  def command(*args)
29
- super(*args).envvar('PATH', path_with_git_subrepo)
28
+ super.envvar('PATH', path_with_git_subrepo)
30
29
  end
31
30
 
32
31
  def gem_root
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
 
5
5
  module EacGit
6
6
  class Local
@@ -10,8 +10,9 @@ module EacGit
10
10
  common_constructor :local, :name
11
11
 
12
12
  # @return [String]
13
+ # @deprecated Use {#head_commit_id} instead.
13
14
  def current_commit_id
14
- local.rev_parse(full_ref_name, true)
15
+ head_commit_id
15
16
  end
16
17
 
17
18
  # @return [Boolean]
@@ -22,6 +23,25 @@ module EacGit
22
23
  def full_ref_name
23
24
  "#{REFS_PREFIX}#{name}"
24
25
  end
26
+
27
+ # @return [EacGit::Local::Commit]
28
+ def head_commit
29
+ local.commit(head_commit_id, true)
30
+ end
31
+
32
+ # @return [String]
33
+ def head_commit_id
34
+ local.rev_parse(full_ref_name, true)
35
+ end
36
+
37
+ # @param remote [EacGit::Local::Remote]
38
+ # @return [void]
39
+ def push(remote, options = {})
40
+ options[:refspec] = name
41
+ options.inject(remote.push) do |a, e|
42
+ a.send(*e)
43
+ end.perform
44
+ end
25
45
  end
26
46
  end
27
47
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
 
5
5
  module EacGit
6
6
  class Local
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
  require 'eac_git/local/commit/diff_tree_line'
5
5
 
6
6
  module EacGit
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
 
5
5
  module EacGit
6
6
  class Local
@@ -53,7 +53,7 @@ module EacGit
53
53
 
54
54
  # @return [Array<EacGit::Local::Commit>]
55
55
  def parents
56
- format('%P').each_line.map { |line| repo.commitize(line) }
56
+ format('%P').each_line.map { |line| repo.commitize(line) } # rubocop:disable Style/RedundantFormat
57
57
  end
58
58
 
59
59
  def root_child?
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
  require 'ostruct'
5
5
 
6
6
  module EacGit
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_git/remote'
4
- require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils'
5
5
 
6
6
  module EacGit
7
7
  class Local
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils'
4
+
5
+ module EacGit
6
+ class Local
7
+ class Remote
8
+ class Push
9
+ acts_as_immutable
10
+ immutable_accessor :force, type: :boolean
11
+ immutable_accessor :refspec, type: :array
12
+
13
+ common_constructor :remote
14
+ delegate :local, to: :remote
15
+
16
+ # @return [Array<Object>]
17
+ def immutable_constructor_args
18
+ [remote]
19
+ end
20
+
21
+ # @return [void]
22
+ def perform
23
+ local.command(*git_command_args).system!
24
+ end
25
+
26
+ # @return [Enumerable<String>]
27
+ def git_command_args
28
+ r = ['push', remote.name]
29
+ r << '--force' if force?
30
+ r + refspecs
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_git/remote_like'
4
- require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils'
5
5
 
6
6
  module EacGit
7
7
  class Local
@@ -22,6 +22,11 @@ module EacGit
22
22
  local.command(*args)
23
23
  end
24
24
 
25
+ # @return [EacGit::Local::Remote::Push]
26
+ def push
27
+ ::EacGit::Local::Remote::Push.new(self)
28
+ end
29
+
25
30
  # @return [String]
26
31
  def remote_reference
27
32
  name
@@ -38,6 +43,8 @@ module EacGit
38
43
  def url=(new_url)
39
44
  local.command('remote', 'set-url', name, new_url).execute!
40
45
  end
46
+
47
+ require_sub __FILE__
41
48
  end
42
49
  end
43
50
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
  require 'eac_git/local/remote'
5
5
 
6
6
  module EacGit
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
  require 'parseconfig'
5
5
 
6
6
  module EacGit
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_git/remote'
4
- require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils'
5
5
 
6
6
  module EacGit
7
7
  class Local
data/lib/eac_git/local.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_git/executables'
4
- require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils'
5
5
 
6
6
  module EacGit
7
7
  # A Git repository in local filesystem.
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'eac_git/executables'
4
4
  require 'eac_git/remote_like'
5
- require 'eac_ruby_utils/core_ext'
5
+ require 'eac_ruby_utils'
6
6
 
7
7
  module EacGit
8
8
  # A Git remote repository referenced by URI.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
 
5
5
  module EacGit
6
6
  module RemoteLike
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
 
5
5
  module EacGit
6
6
  module RemoteLike
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
 
5
5
  module EacGit
6
6
  module Rspec
@@ -3,7 +3,7 @@
3
3
  require 'eac_git/local'
4
4
  require 'eac_git/rspec/stubbed_git_local_repo/directory'
5
5
  require 'eac_git/rspec/stubbed_git_local_repo/file'
6
- require 'eac_ruby_utils/core_ext'
6
+ require 'eac_ruby_utils'
7
7
  require 'securerandom'
8
8
 
9
9
  module EacGit
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/envs'
3
+ require 'eac_ruby_utils'
4
4
  require 'tmpdir'
5
5
 
6
6
  module EacGit
data/lib/eac_git/rspec.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
4
 
5
5
  module EacGit
6
6
  module Rspec
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacGit
4
- VERSION = '0.15.0'
4
+ VERSION = '0.17.0'
5
5
  end
data/lib/eac_git.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_utils'
4
+ EacRubyUtils::RootModuleSetup.perform __FILE__
4
5
 
5
6
  module EacGit
6
- require_sub __FILE__
7
7
  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.15.0
4
+ version: 0.17.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: 2023-12-22 00:00:00.000000000 Z
11
+ date: 2025-06-02 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.120'
19
+ version: '0.127'
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.120'
26
+ version: '0.127'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: parseconfig
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -50,14 +50,20 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.9'
53
+ version: '0.11'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.11.1
54
57
  type: :development
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
61
  - - "~>"
59
62
  - !ruby/object:Gem::Version
60
- version: '0.9'
63
+ version: '0.11'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 0.11.1
61
67
  description:
62
68
  email:
63
69
  executables: []
@@ -75,6 +81,7 @@ files:
75
81
  - lib/eac_git/local/dirty_files.rb
76
82
  - lib/eac_git/local/log.rb
77
83
  - lib/eac_git/local/remote.rb
84
+ - lib/eac_git/local/remote/push.rb
78
85
  - lib/eac_git/local/remotes.rb
79
86
  - lib/eac_git/local/subrepo.rb
80
87
  - lib/eac_git/local/subrepo/config.rb