html_to_pdf_conversion 0.3.0 → 0.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
- data/README.md +2 -2
- data/example/example.rb +1 -1
- data/example/example_w_export.rb +1 -1
- data/lib/html_to_pdf_conversion.rb +6 -6
- data/lib/html_to_pdf_conversion/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dae9441fa43a80eb6c982ce0b6a1d85c190de819
|
4
|
+
data.tar.gz: 528c89600bec81fa3295a54d38f32964d52aae67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3471379329f9b37d480546b878fa5618033523a4c5d26ab7adac20a6d6bbf5cca48e89554bfa523940ef0419364cc9ad5f8f2858512b31541b3af4fff6ed7d4
|
7
|
+
data.tar.gz: fb49e3af3e0b1374635840ee6ce5d1c719f33baf5304712fa6e264666451dda24844b852c0a561765388ab6b7ff4edb2fc00bbde1eed048447322f4004f01b5b
|
data/README.md
CHANGED
@@ -55,7 +55,7 @@ In the examples directory you can find demos and samples of general usage of all
|
|
55
55
|
### Setup
|
56
56
|
|
57
57
|
```
|
58
|
-
@client = PDFlayer::Client.new( [access_key], [
|
58
|
+
@client = PDFlayer::Client.new( [access_key], [secret_keyword] )
|
59
59
|
|
60
60
|
```
|
61
61
|
|
@@ -152,7 +152,7 @@ In order to run the tests, the following environment variables needs to be set:
|
|
152
152
|
|
153
153
|
```
|
154
154
|
ACCESS_KEY = [access_key]
|
155
|
-
|
155
|
+
SECRET_KEYWORD = [secret_keyword]
|
156
156
|
```
|
157
157
|
|
158
158
|
|
data/example/example.rb
CHANGED
@@ -5,7 +5,7 @@ require 'dotenv'
|
|
5
5
|
Dotenv.load
|
6
6
|
|
7
7
|
# Declare the Client instance passing in the authentication parameters
|
8
|
-
@client = PDFlayer::Client.new(ENV['ACCESS_KEY'], ENV['
|
8
|
+
@client = PDFlayer::Client.new(ENV['ACCESS_KEY'], ENV['SECRET_KEYWORD'])
|
9
9
|
|
10
10
|
# Set the URL to get as PDF, we take a random URL from Wikipedia
|
11
11
|
document_url = 'https://en.wikipedia.org/wiki/Special:Random'
|
data/example/example_w_export.rb
CHANGED
@@ -5,7 +5,7 @@ require 'dotenv'
|
|
5
5
|
Dotenv.load
|
6
6
|
|
7
7
|
# Declare the Client instance passing in the authentication parameters
|
8
|
-
@client = PDFlayer::Client.new(ENV['ACCESS_KEY'], ENV['
|
8
|
+
@client = PDFlayer::Client.new(ENV['ACCESS_KEY'], ENV['SECRET_KEYWORD'])
|
9
9
|
|
10
10
|
# Set the URL to get as PDF, we take a random URL from Wikipedia
|
11
11
|
document_url = 'https://en.wikipedia.org/wiki/Special:Random'
|
@@ -13,18 +13,18 @@ module PDFlayer
|
|
13
13
|
|
14
14
|
base_uri 'api.pdflayer.com/api'
|
15
15
|
|
16
|
-
def initialize(access_key,
|
16
|
+
def initialize(access_key, secret_keyword)
|
17
17
|
|
18
18
|
if access_key.nil?
|
19
19
|
raise PDFlayer::MissingArgumentException.new 'access_key'
|
20
20
|
end
|
21
21
|
|
22
|
-
if
|
23
|
-
raise PDFlayer::MissingArgumentException.new '
|
22
|
+
if secret_keyword.nil?
|
23
|
+
raise PDFlayer::MissingArgumentException.new 'secret_keyword'
|
24
24
|
end
|
25
25
|
|
26
26
|
@access_key = access_key
|
27
|
-
@
|
27
|
+
@secret_keyword = secret_keyword
|
28
28
|
|
29
29
|
end
|
30
30
|
|
@@ -39,9 +39,9 @@ module PDFlayer
|
|
39
39
|
# Create a shallow copy so we don't manipulate the original reference
|
40
40
|
query = options.dup
|
41
41
|
|
42
|
-
# Generate the
|
42
|
+
# Generate the SecretKeyword for the request
|
43
43
|
md5 = Digest::MD5.new
|
44
|
-
md5.update document_url + @
|
44
|
+
md5.update document_url + @secret_keyword
|
45
45
|
secret_key = md5.hexdigest
|
46
46
|
|
47
47
|
# Populate the Query
|