gitt 3.12.1 → 4.0.0
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 +4 -4
- data/lib/gitt/parsers/commit.rb +2 -2
- data/lib/gitt/rspec/shared_contexts/git_repo.rb +1 -1
- data/lib/gitt/rspec/shared_contexts/temp_dir.rb +2 -4
- data/lib/gitt/sanitizers/container.rb +1 -1
- data/lib/gitt/sanitizers/{statistic.rb → statistics.rb} +8 -8
- data.tar.gz.sig +0 -0
- metadata +9 -16
- 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: cf995a1e83d2a4b629d45413b6368c0597ee4860bea8116537114a93ee4dfbb4
|
4
|
+
data.tar.gz: b83e9922914f836999e24aecaa9204aa112e50fd9d8b3a44397b202b3e257ecb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af182dd15da70427375a655da1b74d74bb15fa3980bc954f931b591c84bf6cf0fb87aea892b42f65e70ea22b8680dfef2979ed96430f57b1d27fd20dc2af9954
|
7
|
+
data.tar.gz: b8f3056ba6fa218c79c663d0536404db6f4dd7d061f8c1b45ee3c67a6cf958e143c665c840b00d86d9e659b46643b74bb41a9ec419891eeff683072de008c597
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/gitt.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "gitt"
|
5
|
-
spec.version = "
|
5
|
+
spec.version = "4.0.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/gitt"
|
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.signing_key = Gem.default_key_path
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
|
-
spec.required_ruby_version = "
|
26
|
-
spec.add_dependency "core", "~>
|
25
|
+
spec.required_ruby_version = "~> 3.4"
|
26
|
+
spec.add_dependency "core", "~> 2.0"
|
27
27
|
spec.add_dependency "dry-monads", "~> 1.6"
|
28
|
-
spec.add_dependency "refinements", "~>
|
28
|
+
spec.add_dependency "refinements", "~> 13.0"
|
29
29
|
spec.add_dependency "zeitwerk", "~> 2.7"
|
30
30
|
|
31
31
|
spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
data/lib/gitt/parsers/commit.rb
CHANGED
@@ -57,7 +57,7 @@ module Gitt
|
|
57
57
|
|
58
58
|
# :reek:FeatureEnvy
|
59
59
|
def process_statistics attributes
|
60
|
-
attributes.merge!
|
60
|
+
attributes.merge! statistics_sanitizer.call(attributes.delete(:statistics))
|
61
61
|
end
|
62
62
|
|
63
63
|
def lines_sanitizer = sanitizers.fetch :lines
|
@@ -66,7 +66,7 @@ module Gitt
|
|
66
66
|
|
67
67
|
def scissors_sanitizer = sanitizers.fetch :scissors
|
68
68
|
|
69
|
-
def
|
69
|
+
def statistics_sanitizer = sanitizers.fetch :statistics
|
70
70
|
|
71
71
|
def signature_sanitizer = sanitizers.fetch :signature
|
72
72
|
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.shared_context "with temporary directory" do
|
4
|
-
using Refinements::Pathname
|
5
|
-
|
6
4
|
let(:temp_dir) { Bundler.root.join "tmp", "rspec" }
|
7
5
|
|
8
6
|
around do |example|
|
9
|
-
temp_dir.
|
7
|
+
temp_dir.mkpath
|
10
8
|
example.run
|
11
|
-
temp_dir.
|
9
|
+
temp_dir.rmtree
|
12
10
|
end
|
13
11
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Gitt
|
4
4
|
module Sanitizers
|
5
5
|
# Converts raw text into a statistics hash.
|
6
|
-
class
|
6
|
+
class Statistics
|
7
7
|
EMPTY = {files_changed: 0, insertions: 0, deletions: 0}.freeze
|
8
8
|
|
9
9
|
PATTERN = /
|
@@ -12,7 +12,7 @@ module Gitt
|
|
12
12
|
(?<kind>file|insertion|deletion) # Kind capture group.
|
13
13
|
/x
|
14
14
|
|
15
|
-
def self.
|
15
|
+
def self.update attributes, kind, total
|
16
16
|
case kind
|
17
17
|
when "file" then attributes[:files_changed] = total
|
18
18
|
when "insertion" then attributes[:insertions] = total
|
@@ -21,22 +21,22 @@ module Gitt
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def initialize
|
25
|
-
@
|
24
|
+
def initialize attributes = EMPTY, pattern: PATTERN
|
25
|
+
@attributes = attributes
|
26
26
|
@pattern = pattern
|
27
27
|
end
|
28
28
|
|
29
29
|
def call text
|
30
|
-
return
|
30
|
+
return attributes unless text
|
31
31
|
|
32
|
-
text.scan(pattern).each.with_object(
|
33
|
-
self.class.
|
32
|
+
text.scan(pattern).each.with_object(attributes.dup) do |(number, kind), aggregate|
|
33
|
+
self.class.update aggregate, kind, number.to_i
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
private
|
38
38
|
|
39
|
-
attr_reader :
|
39
|
+
attr_reader :attributes, :pattern
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain:
|
11
10
|
- |
|
@@ -35,7 +34,7 @@ cert_chain:
|
|
35
34
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
35
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
36
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-
|
37
|
+
date: 2024-12-27 00:00:00.000000000 Z
|
39
38
|
dependencies:
|
40
39
|
- !ruby/object:Gem::Dependency
|
41
40
|
name: core
|
@@ -43,14 +42,14 @@ dependencies:
|
|
43
42
|
requirements:
|
44
43
|
- - "~>"
|
45
44
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
45
|
+
version: '2.0'
|
47
46
|
type: :runtime
|
48
47
|
prerelease: false
|
49
48
|
version_requirements: !ruby/object:Gem::Requirement
|
50
49
|
requirements:
|
51
50
|
- - "~>"
|
52
51
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
52
|
+
version: '2.0'
|
54
53
|
- !ruby/object:Gem::Dependency
|
55
54
|
name: dry-monads
|
56
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,14 +70,14 @@ dependencies:
|
|
71
70
|
requirements:
|
72
71
|
- - "~>"
|
73
72
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
73
|
+
version: '13.0'
|
75
74
|
type: :runtime
|
76
75
|
prerelease: false
|
77
76
|
version_requirements: !ruby/object:Gem::Requirement
|
78
77
|
requirements:
|
79
78
|
- - "~>"
|
80
79
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
80
|
+
version: '13.0'
|
82
81
|
- !ruby/object:Gem::Dependency
|
83
82
|
name: zeitwerk
|
84
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +92,6 @@ dependencies:
|
|
93
92
|
- - "~>"
|
94
93
|
- !ruby/object:Gem::Version
|
95
94
|
version: '2.7'
|
96
|
-
description:
|
97
95
|
email:
|
98
96
|
- brooke@alchemists.io
|
99
97
|
executables: []
|
@@ -131,7 +129,7 @@ files:
|
|
131
129
|
- lib/gitt/sanitizers/paragraphs.rb
|
132
130
|
- lib/gitt/sanitizers/scissors.rb
|
133
131
|
- lib/gitt/sanitizers/signature.rb
|
134
|
-
- lib/gitt/sanitizers/
|
132
|
+
- lib/gitt/sanitizers/statistics.rb
|
135
133
|
- lib/gitt/sanitizers/trailers.rb
|
136
134
|
- lib/gitt/sanitizers/version.rb
|
137
135
|
- lib/gitt/shell.rb
|
@@ -147,16 +145,12 @@ metadata:
|
|
147
145
|
label: Gitt
|
148
146
|
rubygems_mfa_required: 'true'
|
149
147
|
source_code_uri: https://github.com/bkuhlmann/gitt
|
150
|
-
post_install_message:
|
151
148
|
rdoc_options: []
|
152
149
|
require_paths:
|
153
150
|
- lib
|
154
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
155
152
|
requirements:
|
156
|
-
- - "
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '3.3'
|
159
|
-
- - "<="
|
153
|
+
- - "~>"
|
160
154
|
- !ruby/object:Gem::Version
|
161
155
|
version: '3.4'
|
162
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -165,8 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
159
|
- !ruby/object:Gem::Version
|
166
160
|
version: '0'
|
167
161
|
requirements: []
|
168
|
-
rubygems_version: 3.
|
169
|
-
signing_key:
|
162
|
+
rubygems_version: 3.6.2
|
170
163
|
specification_version: 4
|
171
164
|
summary: A monadic Object API for the Git CLI.
|
172
165
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|