eac_git 0.18.2 → 0.19.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/local/changed_file.rb +2 -2
- data/lib/eac_git/local/commit/diff_tree_line.rb +1 -1
- data/lib/eac_git/local/remote.rb +33 -7
- data/lib/eac_git/local.rb +2 -2
- data/lib/eac_git/version.rb +1 -1
- metadata +5 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '092b52ceaea2db09c3c8f5b6292b860f87a775cd818462718b6789e74b209ba1'
|
|
4
|
+
data.tar.gz: c871c89726e686ed404cf72fb7e188aa73ac97c724d3c9bc3626db2ddd4dd808
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c7e0ba1a5ebad04b8dccd20d01aa3a5f490554f170652fffdea8bdfbb980106fcd946cefc9b95c08595f643541c9db9ee948625998a848846f63b97f84311a76
|
|
7
|
+
data.tar.gz: c18f5abbbdf68cf5718c77aad368d2afa99888a550f5f8350f8de7cd022674363f5831ecd7c2f0e15cce1a3c8a5dcf33c4000f22297269d044652acbdf9d1010
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module EacGit
|
|
4
4
|
class Local
|
|
5
5
|
class ChangedFile
|
|
6
|
-
QUOTED_PATH_PATTERN = /\A"(.+)"\z
|
|
7
|
-
STATUS_LINE_PATTERN = /\A(.)(.)\s(.+)\z
|
|
6
|
+
QUOTED_PATH_PATTERN = /\A"(.+)"\z/
|
|
7
|
+
STATUS_LINE_PATTERN = /\A(.)(.)\s(.+)\z/
|
|
8
8
|
TO_HASH_ATTRIBUTES = %i[absolute_path index path worktree].freeze
|
|
9
9
|
|
|
10
10
|
class << self
|
|
@@ -4,7 +4,7 @@ module EacGit
|
|
|
4
4
|
class Local
|
|
5
5
|
class Commit
|
|
6
6
|
class DiffTreeLine
|
|
7
|
-
DIFF_TREE_PATTERN = /\A:(\d{6}) (\d{6}) (\S+) (\S+) (\S+)\t(\S.*)\z
|
|
7
|
+
DIFF_TREE_PATTERN = /\A:(\d{6}) (\d{6}) (\S+) (\S+) (\S+)\t(\S.*)\z/
|
|
8
8
|
FIELDS = %w[src_mode dst_mode src_sha1 dst_sha1 status path].freeze
|
|
9
9
|
GIT_COMMAND_ARGS = %w[-c core.quotepath=off diff-tree --no-commit-id -r --full-index].freeze
|
|
10
10
|
|
data/lib/eac_git/local/remote.rb
CHANGED
|
@@ -10,13 +10,19 @@ module EacGit
|
|
|
10
10
|
|
|
11
11
|
common_constructor :local, :name
|
|
12
12
|
|
|
13
|
+
# @return [String]
|
|
14
|
+
def add(url)
|
|
15
|
+
local.command('remote', 'add', name, url).execute!
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @return [Boolean]
|
|
13
19
|
def exist?
|
|
14
|
-
url
|
|
20
|
+
url.present?
|
|
15
21
|
end
|
|
16
22
|
|
|
17
23
|
# @return [EacRubyUtils::Envs::Command
|
|
18
|
-
def git_command(*
|
|
19
|
-
local.command(*
|
|
24
|
+
def git_command(*)
|
|
25
|
+
local.command(*)
|
|
20
26
|
end
|
|
21
27
|
|
|
22
28
|
# @return [EacGit::Local::Remote::Push]
|
|
@@ -29,16 +35,36 @@ module EacGit
|
|
|
29
35
|
name
|
|
30
36
|
end
|
|
31
37
|
|
|
38
|
+
# @return [String]
|
|
39
|
+
def remove
|
|
40
|
+
local.command('remote', 'remove', name).execute!
|
|
41
|
+
end
|
|
42
|
+
|
|
32
43
|
# @return [String, nil]
|
|
33
44
|
def url
|
|
34
|
-
|
|
35
|
-
.execute!(exit_outputs: { NO_SUCH_REMOTE_CODE => nil })
|
|
36
|
-
.if_present(nil, &:strip)
|
|
45
|
+
url_get(exit_outputs: { NO_SUCH_REMOTE_CODE => nil }).if_present(nil, &:strip)
|
|
37
46
|
end
|
|
38
47
|
|
|
39
48
|
# @return [String]
|
|
40
49
|
def url=(new_url)
|
|
41
|
-
|
|
50
|
+
case [exist?, new_url.present?]
|
|
51
|
+
when [false, false] # do nothing
|
|
52
|
+
when [false, true] then add(new_url)
|
|
53
|
+
when [true, false] then remove
|
|
54
|
+
when [true, true] then url_set(new_url)
|
|
55
|
+
else ibr
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
def url_get(**)
|
|
61
|
+
local.command('remote', 'get-url', name).execute!(**)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# @param url [String]
|
|
65
|
+
# @return [String]
|
|
66
|
+
def url_set(url)
|
|
67
|
+
local.command('remote', 'set-url', name, url).execute!
|
|
42
68
|
end
|
|
43
69
|
end
|
|
44
70
|
end
|
data/lib/eac_git/local.rb
CHANGED
data/lib/eac_git/version.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.19.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: 2026-05-
|
|
11
|
+
date: 2026-05-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: eac_ruby_utils
|
|
@@ -50,20 +50,14 @@ dependencies:
|
|
|
50
50
|
requirements:
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '0.
|
|
54
|
-
- - ">="
|
|
55
|
-
- !ruby/object:Gem::Version
|
|
56
|
-
version: 0.12.2
|
|
53
|
+
version: '0.13'
|
|
57
54
|
type: :development
|
|
58
55
|
prerelease: false
|
|
59
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
60
57
|
requirements:
|
|
61
58
|
- - "~>"
|
|
62
59
|
- !ruby/object:Gem::Version
|
|
63
|
-
version: '0.
|
|
64
|
-
- - ">="
|
|
65
|
-
- !ruby/object:Gem::Version
|
|
66
|
-
version: 0.12.2
|
|
60
|
+
version: '0.13'
|
|
67
61
|
description:
|
|
68
62
|
email:
|
|
69
63
|
executables: []
|
|
@@ -319,7 +313,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
319
313
|
requirements:
|
|
320
314
|
- - ">="
|
|
321
315
|
- !ruby/object:Gem::Version
|
|
322
|
-
version: '2
|
|
316
|
+
version: '3.2'
|
|
323
317
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
318
|
requirements:
|
|
325
319
|
- - ">="
|