gitt 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3f9b5c99c934220cc4eaa0cb65188d4d2234c1e0f83ce73ec4ce3d4a1bc87d9
4
- data.tar.gz: 9a7c6b431f48e7f21efb422166e964dd8632deeda52c68cdf4a12345298f5e84
3
+ metadata.gz: a5ff1ce3f214ddc0a9a1292d982963d45c2a10e200786492be855847cfda2c06
4
+ data.tar.gz: d805aab1d31f716778b11daa59a2b3a3cb7cc391d8136ed9e955a259576a76e4
5
5
  SHA512:
6
- metadata.gz: e83f8faf4d010deb1c7ec59ceac33c07cafe4afd8ee298fbb73a4af3a2dccb30c9f679d25e5b4334f785cb79e9ca7615991bc94dc66a8a8430eefb708321c22b
7
- data.tar.gz: b903fe7212f0afed1c6d054308896a96f879680c8736a042a8b54754bff29df5daec1e87536ea4bc02e29553f731a946c3924d2f2ea5fe4b243f30a4a5e7e781
6
+ metadata.gz: 7231dc3da9238965494946e4aa72697072cb1bd4a8836b5905ed00169fe6e2e6a0942695e170687022abcf6f055d5010ef256984a829574d3ef0c53d00e31c1a
7
+ data.tar.gz: 87afa967679ad09149a13cb0655458ea93c17659292023ef261880a1b730e6efcf723710eeca69224157ac7a48d67e1710a562e4cf82db77c816575e6a1e92f4
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.3.0"
5
+ spec.version = "5.4.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/gitt"
@@ -1,27 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "core"
4
- require "refinements/array"
5
4
  require "strscan"
6
5
 
7
6
  module Gitt
8
7
  module Sanitizers
9
8
  # Detects and parses paragraphs (including code blocks).
10
9
  class Paragraphs
11
- using Refinements::Array
12
-
13
10
  PATTERN = /
14
- ( # Condition start.
15
- (?:\..*?\n)? # Optional ASCII Doc label.
16
- (?:\[.*\]\n)? # Optional ASCII Doc directive.
17
- [-_=+.*]{4} # ASCII Doc block start.
18
- [\s\S]*? # Lazy block content of any character.
19
- [-_=+.*]{4} # ASCII Doc block end.
20
- | # Or.
21
- ``` # Markdown start.
22
- [\s\S]*? # Lazy block content of any character.
23
- ``` # Markdown end.
24
- ) # Condition end.
11
+ ( # Condition start.
12
+ (?: # Opens non-capture group.
13
+ \. # Dot character.
14
+ (?!\s) # Negative look ahead for whitespace character.
15
+ [^\n]*? # Non-greedy match for non-whitespace characters.
16
+ \n # New line character.
17
+ ) # End of non-capture group.
18
+ ? # Makes above capture group optional.
19
+ (?: # Opens non-capture group.
20
+ \[ # Open bracket character.
21
+ .* # Greedy matches any character zero or more times.
22
+ \] # Close bracket character.
23
+ \n # New line character.
24
+ ) # Closes non-capture group.
25
+ ? # Makes above capture group optional.
26
+ [-_=+.*]{4} # ASCII Doc block start.
27
+ [\s\S]*? # Lazy block content with any character.
28
+ [-_=+.*]{4} # ASCII Doc block end.
29
+ | # Or.
30
+ ``` # Markdown start.
31
+ [\s\S]*? # Lazy block content with any character.
32
+ ``` # Markdown end.
33
+ ) # Condition end.
25
34
  /mx
26
35
 
27
36
  def initialize pattern: PATTERN, client: StringScanner
@@ -29,7 +38,7 @@ module Gitt
29
38
  @client = client
30
39
  end
31
40
 
32
- def call(text) = scan(client.new(text.to_s))
41
+ def call(text) = scan client.new(text.to_s)
33
42
 
34
43
  private
35
44
 
@@ -40,13 +49,13 @@ module Gitt
40
49
  until scanner.eos?
41
50
  match = scanner.scan_until pattern
42
51
 
43
- break collection << scanner.string[scanner.rest].tap(&:strip!).split("\n\n") unless match
52
+ break collection.concat scanner.rest.strip.split("\n\n") unless match
44
53
 
45
- collection << scanner.pre_match.strip
54
+ collection.concat scanner.pre_match.strip.split("\n\n").drop(collection.length)
46
55
  collection << scanner.captures
47
56
  end
48
57
 
49
- collection.tap(&:flatten!).tap(&:compress!)
58
+ collection.tap(&:flatten!)
50
59
  end
51
60
  end
52
61
  end
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: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubygems_version: 4.0.13
162
+ rubygems_version: 4.0.14
163
163
  specification_version: 4
164
164
  summary: A monadic Object API for the Git CLI.
165
165
  test_files: []
metadata.gz.sig CHANGED
Binary file