gitt 3.0.0 → 3.1.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/models/trailer.rb +2 -0
- data/lib/gitt/parsers/trailer.rb +13 -9
- data/lib/gitt/sanitizers/trailers.rb +5 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: fb7ec3501848841e8cf7107ae8ae9823b5e28aa04c5815ddf7a82357621a09ec
|
4
|
+
data.tar.gz: 4d88f589085bcd04af260b5231d12dd7e9b0121a311ee3d8788a7320eac32d09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8beec7a750f4072983d768ea4bf4c306841660227c58848f2b2f99c5e35a0429d2c9dc3e8d2f5cbde5acfe9bfce6c73349d8877b17d5caa4e02df7a8e2cf399a
|
7
|
+
data.tar.gz: f058ef5e0878efc62b8125f91706d1f6bf75c66283b19b9ce4112183b74125fc18f7b3f658661993b4b0b88ffed108060e9579fb944cb6432c7e103dce61862c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/gitt.gemspec
CHANGED
data/lib/gitt/models/trailer.rb
CHANGED
data/lib/gitt/parsers/trailer.rb
CHANGED
@@ -5,23 +5,27 @@ module Gitt
|
|
5
5
|
# Parses raw trailer data to produce a trailer record.
|
6
6
|
class Trailer
|
7
7
|
PATTERN = /
|
8
|
-
|
9
|
-
(?<
|
10
|
-
(?<
|
11
|
-
(?<
|
12
|
-
|
8
|
+
\A # Start of line.
|
9
|
+
(?<key>.+) # Key.
|
10
|
+
(?<delimiter>:) # Colon delimiter.
|
11
|
+
(?<space>\s?) # Space (optional).
|
12
|
+
(?<value>.*?) # Value.
|
13
|
+
\Z # End of line.
|
13
14
|
/x
|
14
15
|
|
15
|
-
|
16
|
+
EMPTY = Models::Trailer[key: nil, value: nil]
|
17
|
+
|
18
|
+
def initialize pattern: PATTERN, model: Models::Trailer, empty: EMPTY
|
16
19
|
@pattern = pattern
|
17
20
|
@model = model
|
18
|
-
@empty =
|
21
|
+
@empty = empty
|
19
22
|
end
|
20
23
|
|
21
24
|
def call content
|
25
|
+
return empty if content.start_with? "#"
|
26
|
+
|
22
27
|
content.match(pattern)
|
23
|
-
.then { |data| data ? data.named_captures(symbolize_names: true) : empty }
|
24
|
-
.then { |attributes| model[**attributes] }
|
28
|
+
.then { |data| data ? model[**data.named_captures(symbolize_names: true)] : empty }
|
25
29
|
end
|
26
30
|
|
27
31
|
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.1.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-
|
38
|
+
date: 2024-02-18 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: core
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
rubygems_version: 3.5.
|
163
|
+
rubygems_version: 3.5.6
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: A monadic Object API for the Git CLI.
|
metadata.gz.sig
CHANGED
Binary file
|