pdfire 1.0.0 → 1.1.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 +1 -1
- data/lib/client.rb +13 -0
- data/lib/conversion_params.rb +3 -0
- data/lib/merge_params.rb +5 -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: cecb8112e6c3ea6117bd793f81846d7e1dfb2f2e9096266de0f823efad911967
|
|
4
|
+
data.tar.gz: 1d383f9e1104f4089d7aee3ec6f8ef554fed3d723bbbdbf7f190209c9319fb3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03b71eff8348d8ddb9184f67dd270965547d72932f419b78204e27c4a831221eaa0d94409cfb24ff3ea4c152dae1740b0efe98823c4dd132208ddb1521b6bc11
|
|
7
|
+
data.tar.gz: 3c6648c5eb75450c214572548d8be2f9e2df792ab541542abbe5269c986b43bb2fa61cb2980e5d648847a5140b63a585dbca24c051a05a431b4d120227e285bc
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
This
|
|
5
|
+
This package provides a client for the [PDFire.io](https://pdfire.io) API. Read the [Documentation](https://docs.pdfire.io) for a list of available options.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
data/lib/client.rb
CHANGED
|
@@ -73,6 +73,19 @@ module PDFire
|
|
|
73
73
|
self.convert params
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
+
# @param params [ConversionParams, MergeParams] the conversion/merge parameters.
|
|
77
|
+
# @param options [Hash] the storage options.
|
|
78
|
+
# @return [Conversion] the conversion.
|
|
79
|
+
def convert_using_storage(params, options = nil)
|
|
80
|
+
if options != nil
|
|
81
|
+
params.storage = options
|
|
82
|
+
else
|
|
83
|
+
params.storage = true
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
self.convert params
|
|
87
|
+
end
|
|
88
|
+
|
|
76
89
|
def result(response)
|
|
77
90
|
content_type = response.header['content-type']
|
|
78
91
|
|
data/lib/conversion_params.rb
CHANGED
|
@@ -6,6 +6,8 @@ module PDFire
|
|
|
6
6
|
attr_accessor :url
|
|
7
7
|
# @return [Boolean]
|
|
8
8
|
attr_accessor :cdn
|
|
9
|
+
# @return [Boolean, Hash]
|
|
10
|
+
attr_accessor :storage
|
|
9
11
|
# @return [Boolean]
|
|
10
12
|
attr_accessor :landscape
|
|
11
13
|
# @return [Boolean]
|
|
@@ -79,6 +81,7 @@ module PDFire
|
|
|
79
81
|
map['html'] = @html if @html != nil
|
|
80
82
|
map['url'] = @url if @url != nil
|
|
81
83
|
map['cdn'] = @cdn if @cdn != nil
|
|
84
|
+
map['storage'] = @storage if @storage != nil
|
|
82
85
|
map['landscape'] = @landscape if @landscape != nil
|
|
83
86
|
map['printBackground'] = @print_background if @print_background != nil
|
|
84
87
|
map['scale'] = @scale if @scale != nil
|
data/lib/merge_params.rb
CHANGED
|
@@ -4,14 +4,17 @@ module PDFire
|
|
|
4
4
|
attr_accessor :documents
|
|
5
5
|
# @return [Boolean]
|
|
6
6
|
attr_accessor :cdn
|
|
7
|
+
# @return [Boolean, Hash]
|
|
8
|
+
attr_accessor :storage
|
|
7
9
|
# @return [String]
|
|
8
10
|
attr_accessor :owner_password
|
|
9
11
|
# @return [String]
|
|
10
12
|
attr_accessor :user_password
|
|
11
13
|
|
|
12
|
-
def initialize(documents = [], cdn = nil, owner_password = nil, user_password = nil)
|
|
14
|
+
def initialize(documents = [], cdn = nil, storage = nil, owner_password = nil, user_password = nil)
|
|
13
15
|
@documents = documents
|
|
14
16
|
@cdn = cdn
|
|
17
|
+
@storage = storage
|
|
15
18
|
@owner_password = owner_password
|
|
16
19
|
@user_password = user_password
|
|
17
20
|
end
|
|
@@ -20,6 +23,7 @@ module PDFire
|
|
|
20
23
|
map = {}
|
|
21
24
|
map['documents'] = @documents.map { |doc| doc.to_map } if @documents.length > 0
|
|
22
25
|
map['cdn'] = @cdn if @cdn != nil
|
|
26
|
+
map['storage'] = @storage if @storage != nil
|
|
23
27
|
map['ownerPassword'] = @owner_password if @owner_password != nil
|
|
24
28
|
map['userPassword'] = @user_password if @user_password != nil
|
|
25
29
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pdfire
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- modernice Ltd.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: PDFire API client for ruby. Get an API key at https://pdfire.io
|
|
14
14
|
email: info@modernice.ltd
|