eac_git 0.16.0 → 0.18.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 +4 -4
- data/lib/eac_git/executables.rb +1 -4
- data/lib/eac_git/local/branch.rb +0 -2
- data/lib/eac_git/local/changed_file.rb +47 -0
- data/lib/eac_git/local/commit/archive.rb +0 -2
- data/lib/eac_git/local/commit/changed_file.rb +0 -3
- data/lib/eac_git/local/commit.rb +1 -3
- data/lib/eac_git/local/dirty_files.rb +2 -24
- data/lib/eac_git/local/log.rb +0 -3
- data/lib/eac_git/local/remote/push.rb +0 -2
- data/lib/eac_git/local/remote.rb +0 -3
- data/lib/eac_git/local/remotes.rb +0 -3
- data/lib/eac_git/local/subrepo/config.rb +0 -3
- data/lib/eac_git/local/subrepo.rb +0 -3
- data/lib/eac_git/local.rb +0 -3
- data/lib/eac_git/remote.rb +0 -4
- data/lib/eac_git/remote_like/ls_result.rb +0 -2
- data/lib/eac_git/remote_like.rb +0 -2
- data/lib/eac_git/rspec/setup.rb +0 -3
- data/lib/eac_git/rspec/stubbed_git_local_repo/directory.rb +0 -1
- data/lib/eac_git/rspec/stubbed_git_local_repo/file.rb +0 -1
- data/lib/eac_git/rspec/stubbed_git_local_repo/fs_object.rb +0 -2
- data/lib/eac_git/rspec/stubbed_git_local_repo/repository.rb +0 -4
- data/lib/eac_git/rspec/stubbed_git_local_repo.rb +0 -1
- data/lib/eac_git/rspec.rb +0 -2
- data/lib/eac_git/version.rb +1 -1
- data/lib/eac_git.rb +4 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3daa829b6232f56446b82684a071ebcf939bd1e98307284a2c9b559b881a70b
|
4
|
+
data.tar.gz: 6ddd44efac225b1813761e4e4a4de0e7d3a4e3d2a8a45e386ee49a59ddd3c1e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ff9b942f598fd22e0e7eec9de6ef7932ee78d069cba3e226e771c5430f2b0ddcc23d9716da160e6b172683d787d0765a062ac737052e1dde119a69bb4dc6ef0
|
7
|
+
data.tar.gz: 3312de1776a0e748bf271669e5a16fc4f2cd1c8d903530bb8715c8827d00629609600d11bfbfe44f2c14609a8b6956ffdbcbed24d18a6299147db7f1108b092d
|
data/lib/eac_git/executables.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'eac_ruby_utils/envs'
|
5
|
-
|
6
3
|
module EacGit
|
7
4
|
module Executables
|
8
5
|
class << self
|
@@ -26,7 +23,7 @@ module EacGit
|
|
26
23
|
|
27
24
|
module GitCommandExtensions
|
28
25
|
def command(*args)
|
29
|
-
super
|
26
|
+
super.envvar('PATH', path_with_git_subrepo)
|
30
27
|
end
|
31
28
|
|
32
29
|
def gem_root
|
data/lib/eac_git/local/branch.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacGit
|
4
|
+
class Local
|
5
|
+
class ChangedFile
|
6
|
+
QUOTED_PATH_PATTERN = /\A"(.+)"\z/.freeze
|
7
|
+
STATUS_LINE_PATTERN = /\A(.)(.)\s(.+)\z/.freeze
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def by_porcelain_v1_line(local_repo, line)
|
11
|
+
STATUS_LINE_PATTERN.match(line.gsub(/\n\z/, '')).then do |m|
|
12
|
+
new(local_repo, m[1], m[2], parse_status_line_path(m[3]).to_pathname)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param path [String]
|
17
|
+
# @return [String]
|
18
|
+
def parse_status_line_path(path)
|
19
|
+
m = QUOTED_PATH_PATTERN.match(path)
|
20
|
+
m ? m[1] : path
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
common_constructor :local_repo, :index, :worktree, :path
|
25
|
+
|
26
|
+
# @return [Pathname]
|
27
|
+
def absolute_path
|
28
|
+
path.expand_path(local_repo.root_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Boolean]
|
32
|
+
def add?
|
33
|
+
(index == '?' && worktree == '?') || (index == 'A' && worktree == ' ')
|
34
|
+
end
|
35
|
+
|
36
|
+
# @return [Boolean]
|
37
|
+
def delete?
|
38
|
+
[index, worktree].include?('D')
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [Boolean]
|
42
|
+
def modify?
|
43
|
+
[index, worktree].include?('M')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/eac_git/local/commit.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
3
|
module EacGit
|
6
4
|
class Local
|
7
5
|
class Commit
|
@@ -53,7 +51,7 @@ module EacGit
|
|
53
51
|
|
54
52
|
# @return [Array<EacGit::Local::Commit>]
|
55
53
|
def parents
|
56
|
-
format('%P').each_line.map { |line| repo.commitize(line) }
|
54
|
+
format('%P').each_line.map { |line| repo.commitize(line) } # rubocop:disable Style/RedundantFormat
|
57
55
|
end
|
58
56
|
|
59
57
|
def root_child?
|
@@ -1,14 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
3
|
require 'ostruct'
|
5
4
|
|
6
5
|
module EacGit
|
7
6
|
class Local
|
8
7
|
module DirtyFiles
|
9
|
-
QUOTED_PATH_PATTERN = /\A"(.+)"\z/.freeze
|
10
|
-
STATUS_LINE_PATTERN = /\A(.)(.)\s(.+)\z/.freeze
|
11
|
-
|
12
8
|
def dirty?
|
13
9
|
dirty_files.any?
|
14
10
|
end
|
@@ -22,26 +18,8 @@ module EacGit
|
|
22
18
|
|
23
19
|
def dirty_files
|
24
20
|
command('status', '--porcelain=v1', '--untracked-files', '--no-renames')
|
25
|
-
.execute!.each_line
|
26
|
-
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
# @param line [String]
|
31
|
-
# @return [Struct]
|
32
|
-
def parse_status_line(line)
|
33
|
-
STATUS_LINE_PATTERN.if_match(line) do |m|
|
34
|
-
path = parse_status_line_path(m[3]).to_pathname
|
35
|
-
{ index: m[1], worktree: m[2], path: path, absolute_path: path.expand_path(root_path) }
|
36
|
-
.to_struct
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# @param path [String]
|
41
|
-
# @return [String]
|
42
|
-
def parse_status_line_path(path)
|
43
|
-
m = QUOTED_PATH_PATTERN.match(path)
|
44
|
-
m ? m[1] : path
|
21
|
+
.execute!.each_line
|
22
|
+
.map { |line| ::EacGit::Local::ChangedFile.by_porcelain_v1_line(self, line) }
|
45
23
|
end
|
46
24
|
end
|
47
25
|
end
|
data/lib/eac_git/local/log.rb
CHANGED
data/lib/eac_git/local/remote.rb
CHANGED
data/lib/eac_git/local.rb
CHANGED
data/lib/eac_git/remote.rb
CHANGED
data/lib/eac_git/remote_like.rb
CHANGED
data/lib/eac_git/rspec/setup.rb
CHANGED
data/lib/eac_git/rspec.rb
CHANGED
data/lib/eac_git/version.rb
CHANGED
data/lib/eac_git.rb
CHANGED
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.
|
4
|
+
version: 0.18.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:
|
11
|
+
date: 2025-06-17 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.
|
19
|
+
version: '0.128'
|
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.
|
26
|
+
version: '0.128'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: parseconfig
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.12'
|
54
54
|
type: :development
|
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.
|
60
|
+
version: '0.12'
|
61
61
|
description:
|
62
62
|
email:
|
63
63
|
executables: []
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/eac_git/executables.rb
|
69
69
|
- lib/eac_git/local.rb
|
70
70
|
- lib/eac_git/local/branch.rb
|
71
|
+
- lib/eac_git/local/changed_file.rb
|
71
72
|
- lib/eac_git/local/commit.rb
|
72
73
|
- lib/eac_git/local/commit/archive.rb
|
73
74
|
- lib/eac_git/local/commit/changed_file.rb
|