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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/gitt.gemspec +1 -1
- data/lib/gitt/sanitizers/paragraphs.rb +27 -18
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: a5ff1ce3f214ddc0a9a1292d982963d45c2a10e200786492be855847cfda2c06
|
|
4
|
+
data.tar.gz: d805aab1d31f716778b11daa59a2b3a3cb7cc391d8136ed9e955a259576a76e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7231dc3da9238965494946e4aa72697072cb1bd4a8836b5905ed00169fe6e2e6a0942695e170687022abcf6f055d5010ef256984a829574d3ef0c53d00e31c1a
|
|
7
|
+
data.tar.gz: 87afa967679ad09149a13cb0655458ea93c17659292023ef261880a1b730e6efcf723710eeca69224157ac7a48d67e1710a562e4cf82db77c816575e6a1e92f4
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/gitt.gemspec
CHANGED
|
@@ -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
|
-
(
|
|
15
|
-
(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
[
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
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
|
|
52
|
+
break collection.concat scanner.rest.strip.split("\n\n") unless match
|
|
44
53
|
|
|
45
|
-
collection
|
|
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!)
|
|
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.
|
|
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.
|
|
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
|