grover 0.14.1 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grover.rb +9 -0
- data/lib/grover/js/processor.js +16 -0
- data/lib/grover/processor.rb +1 -0
- data/lib/grover/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dae47620d2a732cab442444c25a6954f103c669fa7eea7c092b34297f1d71c0
|
4
|
+
data.tar.gz: 84d886147feff66e75276b00d5e6529883396763dcc424d6e42186c5dbb9b9d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad7d5f4c5a15b8a9bc7ea7041ad1184c72416944b4c837c16592197e5105cebccee53eae564b9fbf8776884fb4b4e1d7d888de7c2018b0040c085979c65e55f
|
7
|
+
data.tar.gz: b8837766f459146e6349df80952f655dc330c7d9ca7cdebcbdd2a69fe17a10701addb1ff029ebfacd3458780b1d134679128df8766c1b017904c76dd876e43d2
|
data/lib/grover.rb
CHANGED
@@ -50,6 +50,15 @@ class Grover
|
|
50
50
|
processor.convert :pdf, @url, normalized_options(path: path)
|
51
51
|
end
|
52
52
|
|
53
|
+
#
|
54
|
+
# Request URL with provided options and render HTML
|
55
|
+
#
|
56
|
+
# @return [String] The resulting HTML string
|
57
|
+
#
|
58
|
+
def to_html
|
59
|
+
processor.convert :content, @url, normalized_options(path: nil)
|
60
|
+
end
|
61
|
+
|
53
62
|
#
|
54
63
|
# Request URL with provided options and create screenshot
|
55
64
|
#
|
data/lib/grover/js/processor.js
CHANGED
@@ -101,6 +101,22 @@ const _processPage = (async (convertAction, urlOrHtml, options) => {
|
|
101
101
|
}
|
102
102
|
}
|
103
103
|
|
104
|
+
// add styles (if provided)
|
105
|
+
const styleTagOptions = options.styleTagOptions; delete options.styleTagOptions;
|
106
|
+
if (Array.isArray(styleTagOptions)) {
|
107
|
+
for (const styleTagOption of styleTagOptions) {
|
108
|
+
await page.addStyleTag(styleTagOption);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
// add scripts (if provided)
|
113
|
+
const scriptTagOptions = options.scriptTagOptions; delete options.scriptTagOptions;
|
114
|
+
if (Array.isArray(scriptTagOptions)) {
|
115
|
+
for (const scriptTagOption of scriptTagOptions) {
|
116
|
+
await page.addScriptTag(scriptTagOption);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
104
120
|
// If specified, evaluate script on the page
|
105
121
|
const executeScript = options.executeScript; delete options.executeScript;
|
106
122
|
if (executeScript !== undefined) {
|
data/lib/grover/processor.rb
CHANGED
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: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bromwich
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: combine_pdf
|
@@ -181,7 +181,7 @@ homepage: https://github.com/Studiosity/grover
|
|
181
181
|
licenses:
|
182
182
|
- MIT
|
183
183
|
metadata: {}
|
184
|
-
post_install_message:
|
184
|
+
post_install_message:
|
185
185
|
rdoc_options: []
|
186
186
|
require_paths:
|
187
187
|
- lib
|
@@ -199,8 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
203
|
-
signing_key:
|
202
|
+
rubygems_version: 3.0.6
|
203
|
+
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: A Ruby gem to transform HTML into PDF, PNG or JPEG by wrapping the NodeJS
|
206
206
|
Google Puppeteer driver for Chromium
|