gitt 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4c4eca5127ba8feed6bcb27e0708ac6d4580460a9d9b506f1c195ba071c661e
4
- data.tar.gz: 94787241e549ed1ae3bb6b01a6050b3d88122735fe9c9dcddee3c578f79aaab2
3
+ metadata.gz: fb7ec3501848841e8cf7107ae8ae9823b5e28aa04c5815ddf7a82357621a09ec
4
+ data.tar.gz: 4d88f589085bcd04af260b5231d12dd7e9b0121a311ee3d8788a7320eac32d09
5
5
  SHA512:
6
- metadata.gz: 5171c896cb76cf2b6e138f3bd7d4a201bf5d06800dafa11b46ab8a50ffd678164a8cca087609d28cd64c77847eaf90941cdc5dcf69e85b2de8455d421d072b0c
7
- data.tar.gz: c044661633a4d4bc6c83c4340122a43d701f3fa2215ddb3f10e9d20a65203b875dbb7b1f838bbdc19124087fd050de4c2dcb9cf65e34edc219cb632e28ffb57e
6
+ metadata.gz: 8beec7a750f4072983d768ea4bf4c306841660227c58848f2b2f99c5e35a0429d2c9dc3e8d2f5cbde5acfe9bfce6c73349d8877b17d5caa4e02df7a8e2cf399a
7
+ data.tar.gz: f058ef5e0878efc62b8125f91706d1f6bf75c66283b19b9ce4112183b74125fc18f7b3f658661993b4b0b88ffed108060e9579fb944cb6432c7e103dce61862c
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.1.0"
5
+ spec.version = "3.1.1"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/gitt"
@@ -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
- (?<key>\A.+) # Key (anchored to start of line).
9
- (?<delimiter>:) # Colon delimiter.
10
- (?<space>\s?) # Space (optional).
11
- (?<value>.*?) # Value.
12
- \Z # End of line.
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
- def initialize pattern: PATTERN, model: Models::Trailer
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 = model[key: nil, value: nil].to_h
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.1.0
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-02-13 00:00:00.000000000 Z
38
+ date: 2024-02-18 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: core
metadata.gz.sig CHANGED
Binary file