gitt 3.1.1 → 3.3.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 +2 -2
- data/lib/gitt/parsers/commit.rb +8 -7
- data/lib/gitt/parsers/tag.rb +5 -3
- data/lib/gitt/sanitizers/container.rb +2 -1
- data/lib/gitt/sanitizers/date.rb +1 -1
- data/lib/gitt/sanitizers/email.rb +1 -1
- data/lib/gitt/sanitizers/lines.rb +1 -1
- data/lib/gitt/sanitizers/paragraphs.rb +1 -1
- data/lib/gitt/sanitizers/scissors.rb +1 -1
- data/lib/gitt/sanitizers/signature.rb +2 -2
- data/lib/gitt/sanitizers/trailers.rb +4 -4
- data/lib/gitt/sanitizers/version.rb +9 -0
- data.tar.gz.sig +0 -0
- metadata +6 -5
- 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: 5d4831c7aebb2ababde79c21e8a32d55a6d3db7da01bf16140c4a5b96477250c
|
4
|
+
data.tar.gz: 4ccab61c3639101d924b7beef4be9b4e7ddcbcda43a29d08fe5dd022bb3f426c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1da9361512f66cd9c597e3d53a1d33a926ec891eb65212c98eaa04f6bcb2581df4f65a47da15436d7e6f2f8ff32cfe0d2dd6acf5c7134e0ebe186ef42d1ed56f
|
7
|
+
data.tar.gz: dd84ed45b157da1e0ae49ff5cc89ebcda9d35bc444e0f94479439d26643fd49ce1b3b4d7118f50c487edb368cbccec57e740d1ba51d1e4b39e712013b2781926
|
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 = "3.
|
5
|
+
spec.version = "3.3.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/gitt"
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.required_ruby_version = "~> 3.3"
|
26
26
|
spec.add_dependency "core", "~> 1.0"
|
27
27
|
spec.add_dependency "dry-monads", "~> 1.6"
|
28
|
-
spec.add_dependency "refinements", "~> 12.
|
28
|
+
spec.add_dependency "refinements", "~> 12.1"
|
29
29
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
30
30
|
|
31
31
|
spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
data/lib/gitt/parsers/commit.rb
CHANGED
@@ -4,7 +4,7 @@ require "refinements/hash"
|
|
4
4
|
|
5
5
|
module Gitt
|
6
6
|
module Parsers
|
7
|
-
# Parses raw commit
|
7
|
+
# Parses raw commit to produce a commit record.
|
8
8
|
class Commit
|
9
9
|
using Refinements::Hash
|
10
10
|
|
@@ -16,14 +16,11 @@ module Gitt
|
|
16
16
|
@model = model
|
17
17
|
end
|
18
18
|
|
19
|
-
# rubocop:todo Layout/LineLength
|
20
19
|
def call content
|
21
20
|
attributer.call(content)
|
22
21
|
.then { |attributes| process attributes }
|
23
|
-
.then { |attributes| attributes.merge! statistic_sanitizer.call(attributes.delete(:statistics)) }
|
24
22
|
.then { |attributes| model[**attributes] }
|
25
23
|
end
|
26
|
-
# rubocop:enable Layout/LineLength
|
27
24
|
|
28
25
|
private
|
29
26
|
|
@@ -32,10 +29,9 @@ module Gitt
|
|
32
29
|
# :reek:TooManyStatements
|
33
30
|
def process attributes
|
34
31
|
body, trailers = attributes.values_at :body, :trailers
|
32
|
+
body = scissors_sanitizer.call body
|
35
33
|
|
36
|
-
attributes.transform_with!
|
37
|
-
signature: signature_sanitizer,
|
38
|
-
trailers: trailers_sanitizer
|
34
|
+
attributes.transform_with! signature: signature_sanitizer, trailers: trailers_sanitizer
|
39
35
|
|
40
36
|
attributes[:body] =
|
41
37
|
(trailers ? body.sub(/\n??#{Regexp.escape trailers}\n??/, "") : body).chomp
|
@@ -59,6 +55,11 @@ module Gitt
|
|
59
55
|
attributes[:lines] = lines_sanitizer.call attributes[:raw]
|
60
56
|
end
|
61
57
|
|
58
|
+
# :reek:FeatureEnvy
|
59
|
+
def process_statistics attributes
|
60
|
+
attributes.merge! statistic_sanitizer.call(attributes.delete(:statistics))
|
61
|
+
end
|
62
|
+
|
62
63
|
def lines_sanitizer = sanitizers.fetch :lines
|
63
64
|
|
64
65
|
def paragraphs_sanitizer = sanitizers.fetch :paragraphs
|
data/lib/gitt/parsers/tag.rb
CHANGED
@@ -22,7 +22,7 @@ module Gitt
|
|
22
22
|
authored_at: date_sanitizer,
|
23
23
|
committed_at: date_sanitizer,
|
24
24
|
committer_email: email_sanitizer,
|
25
|
-
version:
|
25
|
+
version: version_serializer
|
26
26
|
model[**attributes]
|
27
27
|
end
|
28
28
|
|
@@ -30,9 +30,11 @@ module Gitt
|
|
30
30
|
|
31
31
|
attr_reader :attributer, :sanitizers, :model
|
32
32
|
|
33
|
-
def date_sanitizer = sanitizers.fetch
|
33
|
+
def date_sanitizer = sanitizers.fetch :date
|
34
34
|
|
35
|
-
def email_sanitizer = sanitizers.fetch
|
35
|
+
def email_sanitizer = sanitizers.fetch :email
|
36
|
+
|
37
|
+
def version_serializer = sanitizers.fetch :version
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
data/lib/gitt/sanitizers/date.rb
CHANGED
@@ -8,10 +8,10 @@ module Gitt
|
|
8
8
|
@parser = parser
|
9
9
|
end
|
10
10
|
|
11
|
-
def call
|
12
|
-
String(
|
13
|
-
|
14
|
-
|
11
|
+
def call text
|
12
|
+
String(text).split("\n")
|
13
|
+
.map { |line| parser.call line }
|
14
|
+
.reject(&:empty?)
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
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.
|
4
|
+
version: 3.3.0
|
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-
|
38
|
+
date: 2024-04-01 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: core
|
@@ -71,14 +71,14 @@ dependencies:
|
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '12.
|
74
|
+
version: '12.1'
|
75
75
|
type: :runtime
|
76
76
|
prerelease: false
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '12.
|
81
|
+
version: '12.1'
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: zeitwerk
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/gitt/sanitizers/signature.rb
|
134
134
|
- lib/gitt/sanitizers/statistic.rb
|
135
135
|
- lib/gitt/sanitizers/trailers.rb
|
136
|
+
- lib/gitt/sanitizers/version.rb
|
136
137
|
- lib/gitt/shell.rb
|
137
138
|
homepage: https://alchemists.io/projects/gitt
|
138
139
|
licenses:
|
@@ -160,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
161
|
- !ruby/object:Gem::Version
|
161
162
|
version: '0'
|
162
163
|
requirements: []
|
163
|
-
rubygems_version: 3.5.
|
164
|
+
rubygems_version: 3.5.7
|
164
165
|
signing_key:
|
165
166
|
specification_version: 4
|
166
167
|
summary: A monadic Object API for the Git CLI.
|
metadata.gz.sig
CHANGED
Binary file
|