gitt 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/gitt.gemspec +1 -1
- data/lib/gitt/commands/log.rb +4 -3
- data/lib/gitt/parsers/commit.rb +2 -2
- data/lib/gitt/repository.rb +5 -1
- data/lib/gitt/sanitizers/statistic.rb +11 -10
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 011f24d793d2565425982cb6eeb0d8efc3a9f954590bf86750495c6b97792873
|
4
|
+
data.tar.gz: ee9f64d17e334f1aa6827c085fb1059b453209f4b5397e7ac400e598de18960e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efe9288bf28a4eac998226055f15bf1ddedeae39dbf4e95c77a6da23faedcd9a3c3b88d8a29db5d7cde1f60273e1bce6c6c2e0d0734964d14e520790b8463d0f
|
7
|
+
data.tar.gz: '089f62916bc44d0634f408a111163bda264a13ad236ce8156484c096e5d595deae0b2c14466885d084647a3ac23d50a8005546e8f75b1d2847fd4b7239d2dcb5'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/gitt.gemspec
CHANGED
data/lib/gitt/commands/log.rb
CHANGED
@@ -70,15 +70,16 @@ module Gitt
|
|
70
70
|
|
71
71
|
# :reek:UtilityFunction
|
72
72
|
def wrap_statistics entries
|
73
|
-
entries.gsub!(/\d+\sfile.+\d+\s(insertion|deletion).+\n/) do |match|
|
74
|
-
|
73
|
+
entries.gsub!(/\n"\n\s\d+\sfile.+\d+\s(insertion|deletion).+\n/) do |match|
|
74
|
+
match.delete_prefix!("\n\"\n").strip!
|
75
|
+
"\n<statistics>#{match}</statistics>\n<break/>"
|
75
76
|
end
|
76
77
|
end
|
77
78
|
|
78
79
|
# :reek:UtilityFunction
|
79
80
|
def add_empty_statistics entries
|
80
81
|
entries.gsub! %(</trailers>\n"\n"<author_email>),
|
81
|
-
"</trailers>\n<statistics></statistics
|
82
|
+
"</trailers>\n<statistics></statistics><break/>\n<author_email>"
|
82
83
|
end
|
83
84
|
end
|
84
85
|
end
|
data/lib/gitt/parsers/commit.rb
CHANGED
@@ -18,7 +18,7 @@ module Gitt
|
|
18
18
|
|
19
19
|
def call content
|
20
20
|
attributer.call(content)
|
21
|
-
.then { |attributes|
|
21
|
+
.then { |attributes| mutate attributes }
|
22
22
|
.then { |attributes| model[**attributes] }
|
23
23
|
end
|
24
24
|
|
@@ -27,7 +27,7 @@ module Gitt
|
|
27
27
|
attr_reader :attributer, :sanitizers, :model
|
28
28
|
|
29
29
|
# :reek:TooManyStatements
|
30
|
-
def
|
30
|
+
def mutate attributes
|
31
31
|
body, trailers = attributes.values_at :body, :trailers
|
32
32
|
body = scissors_sanitizer.call body
|
33
33
|
|
data/lib/gitt/repository.rb
CHANGED
@@ -4,7 +4,6 @@ require "core"
|
|
4
4
|
|
5
5
|
module Gitt
|
6
6
|
# Primary object/wrapper for processing all Git related commands.
|
7
|
-
# :reek:TooManyMethods
|
8
7
|
class Repository
|
9
8
|
COMMANDS = {
|
10
9
|
branch: Commands::Branch,
|
@@ -34,6 +33,11 @@ module Gitt
|
|
34
33
|
|
35
34
|
def get(...) = commands.fetch(:config).get(...)
|
36
35
|
|
36
|
+
def inspect
|
37
|
+
"#<#{self.class}:#{object_id} @shell=#{shell.inspect} " \
|
38
|
+
"@commands=#{commands.values.map(&:class).inspect}>"
|
39
|
+
end
|
40
|
+
|
37
41
|
def log(...) = commands.fetch(__method__).call(...)
|
38
42
|
|
39
43
|
def origin? = commands.fetch(:config).origin?
|
@@ -12,24 +12,25 @@ module Gitt
|
|
12
12
|
(?<kind>file|insertion|deletion) # Kind capture group.
|
13
13
|
/x
|
14
14
|
|
15
|
+
def self.update_stats attributes, kind, total
|
16
|
+
case kind
|
17
|
+
when "file" then attributes[:files_changed] = total
|
18
|
+
when "insertion" then attributes[:insertions] = total
|
19
|
+
when "deletion" then attributes[:deletions] = total
|
20
|
+
else fail StandardError, "Invalid kind: #{kind.inspect}."
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
15
24
|
def initialize empty: EMPTY, pattern: PATTERN
|
16
25
|
@empty = empty
|
17
26
|
@pattern = pattern
|
18
27
|
end
|
19
28
|
|
20
|
-
# :reek:TooManyStatements
|
21
29
|
def call text
|
22
30
|
return empty unless text
|
23
31
|
|
24
|
-
text.scan(pattern).each.with_object(empty.dup) do |(number, kind),
|
25
|
-
|
26
|
-
|
27
|
-
case kind
|
28
|
-
when "file" then stats[:files_changed] = total
|
29
|
-
when "insertion" then stats[:insertions] = total
|
30
|
-
when "deletion" then stats[:deletions] = total
|
31
|
-
# :nocov:
|
32
|
-
end
|
32
|
+
text.scan(pattern).each.with_object(empty.dup) do |(number, kind), aggregate|
|
33
|
+
self.class.update_stats aggregate, kind, number.to_i
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-09-
|
38
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: core
|
metadata.gz.sig
CHANGED
Binary file
|