pdfbucket 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/pdfbucket.rb +3 -3
- data/lib/pdfbucket/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91ca90bb705eb7500cfebd797b85d7d18e563e7b
|
4
|
+
data.tar.gz: 138025a7c1150fbbaf2d71a75a5b6ff4d51be173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09ac81c5f7f5e746b94db0076235c3010e6ded9acf9054628043f3ae7b41a3b7424097518bf18181701f3b74624ad6bee4f631270da0e8f6d32500dc90b5488d
|
7
|
+
data.tar.gz: c3892d0e5f095db219c6e7c7007d48740e7825474a9cf38c5f5fb40f0939cb9763acb2f3e2dae243be6d0aab9c9521752403317b509dedebaa20a38d9c4ff779
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# PDFBucket
|
2
2
|
|
3
|
-
This gem allows you to
|
3
|
+
This gem allows you to integrate easily with the PDFBucket service.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,17 +18,17 @@ $ bundle
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
To
|
22
|
-
The new
|
21
|
+
To encrypt a URL in your code instantiate a PDFBucket object and use its generate_url method.
|
22
|
+
The new pdf_bucket will use `PDF_BUCKET_API_KEY`, `PDF_BUCKET_API_SECRET`, `PDF_BUCKET_API_HOST` (default is `api.pdfbucket.co`) ENV vars:
|
23
23
|
|
24
24
|
```ruby
|
25
|
-
|
25
|
+
pdf_bucket = PDFBucket::PDFBucket.new
|
26
26
|
|
27
27
|
# You can also set any the api params, overwriting then ENV vars like this
|
28
|
-
|
28
|
+
other_pdf_bucket = PDFBucket::PDFBucket.new(api_key: '123', api_secret: '321', api_host: 'api.pdfbucket.co')
|
29
29
|
|
30
|
-
# And you get the
|
31
|
-
|
30
|
+
# And you get the encrypted_url using the generate_url method
|
31
|
+
encrypted_url = pdf_bucket.generate_url('http://example.com', :landscape, :a4, '2px', '0.7')
|
32
32
|
```
|
33
33
|
|
34
34
|
* Possible values for orientation: :landscape, :portrait
|
data/lib/pdfbucket.rb
CHANGED
@@ -18,7 +18,7 @@ module PDFBucket
|
|
18
18
|
}
|
19
19
|
|
20
20
|
# Main class
|
21
|
-
class
|
21
|
+
class PDFBucket
|
22
22
|
attr_reader :api_key, :api_secret, :api_host
|
23
23
|
|
24
24
|
def initialize(
|
@@ -35,7 +35,7 @@ module PDFBucket
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def generate_url(url, orientation, page_size, margin, zoom)
|
38
|
-
|
38
|
+
encrypted_uri = encrypt(api_secret, url)
|
39
39
|
|
40
40
|
query = URI.encode_www_form(
|
41
41
|
orientation: ORIENTATIONS[orientation],
|
@@ -43,7 +43,7 @@ module PDFBucket
|
|
43
43
|
margin: margin,
|
44
44
|
zoom: zoom,
|
45
45
|
api_key: api_key,
|
46
|
-
|
46
|
+
encrypted_uri: encrypted_uri)
|
47
47
|
|
48
48
|
URI::HTTPS.build(
|
49
49
|
host: api_host,
|
data/lib/pdfbucket/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdfbucket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanrodari
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|