pdfbucket 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff8f4b0d4a2708f10af2e5f758a6c4c43a20e27b
4
- data.tar.gz: 958a39472ce639d5142ebca090c8e7d06ce6dafb
3
+ metadata.gz: 91ca90bb705eb7500cfebd797b85d7d18e563e7b
4
+ data.tar.gz: 138025a7c1150fbbaf2d71a75a5b6ff4d51be173
5
5
  SHA512:
6
- metadata.gz: 2f7412b51d0b51548103a95b481a4d6c8e2ef3e3fdb474a6d3c6bf7cdcb98411804c6198905712f878b1d37fcf32871990ea40e13c063364dcc5562838724715
7
- data.tar.gz: 0c0769dfdfa49f36f15e5edd2bd9e1b8d67f78f2aed2dd9b32290403c2643a4ba2ccb9e27d2ea2bebad907d6b27b4bbf5981e696823b8e7b43fdd3531da47dea
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 use easily sign URLs to be used with the PDFBucket service.
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 sign a URL in your code instantiate a signer object and use its generate_url method.
22
- The new signer will use `PDF_BUCKET_API_KEY`, `PDF_BUCKET_API_SECRET`, `PDF_BUCKET_API_HOST` (default is `pdfbucket.kommit.co`) ENV vars:
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
- signer = PDFBucket::Signer.new
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
- other_signer = PDFBucket::Signer.new(api_key: '123', api_secret: '321', api_host: 'potion-api-staging.herokuapp.com')
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 signed_url using the sign method
31
- signed_url = signer.generate_url('http://example.com', :landscape, :a4, '2px', '0.7')
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 Signer
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
- signed_uri = encrypt(api_secret, url)
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
- signed_uri: signed_uri)
46
+ encrypted_uri: encrypted_uri)
47
47
 
48
48
  URI::HTTPS.build(
49
49
  host: api_host,
@@ -1,3 +1,3 @@
1
1
  module PDFBucket
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.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-08 00:00:00.000000000 Z
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler