grover 2.0.0 → 2.0.1
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
- data/lib/grover/processor.rb +7 -0
- data/lib/grover/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb5b937d91e68448cb7d33b190207dca1312046dbf29370814923bbc2a996ec9
|
|
4
|
+
data.tar.gz: 7816fc5566f60b7ebe17747d0a1e0b4ee562134192b1c435ab705da44bb86e6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03ae9f131c703dad8c92e4a00eb6543412f20f260263ec110f7b2635cc245ed4c84ee35f22449731e8805bbe881fe2fef133c50b37d5bb12edec52d79b2c19ac
|
|
7
|
+
data.tar.gz: 9c0591aadb74a69f51292d0a7e9e3201f72a56358dc6ca561a10624635b8a61077c773f781dc3ad2a3c62eae2f5527ce67eaba8ad6c7d7d0aa06e2f157cf6a58
|
data/lib/grover/processor.rb
CHANGED
|
@@ -81,7 +81,9 @@ class Grover
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def call_js_method(method, url_or_html, options) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
84
|
+
url_or_html = sanitize_unicode_control_characters url_or_html
|
|
84
85
|
stdin.puts JSON.dump([method, url_or_html, options])
|
|
86
|
+
|
|
85
87
|
input = stdout.gets
|
|
86
88
|
raise Errno::EPIPE, "Can't read from worker" if input.nil?
|
|
87
89
|
|
|
@@ -120,5 +122,10 @@ class Grover
|
|
|
120
122
|
stderr.close
|
|
121
123
|
wait_thr.join
|
|
122
124
|
end
|
|
125
|
+
|
|
126
|
+
# The line/paragraph separator characters break the JS JSON parser, so replace them with regular newlines
|
|
127
|
+
def sanitize_unicode_control_characters(html)
|
|
128
|
+
html.gsub(/[\u{2028}\u{2029}]/, "\n")
|
|
129
|
+
end
|
|
123
130
|
end
|
|
124
131
|
end
|
data/lib/grover/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grover
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Bromwich
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|