idr_cloud_client 1.0.3 → 2.0.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 +15 -3
- data/example_jpedal_usage.rb +2 -2
- data/lib/idr_cloud_client/version.rb +1 -1
- data/lib/idr_cloud_client.rb +8 -4
- 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: 243edc30989fcbdf3b684228e4ccbd0798f1ec156a8d0509b67a7a2a9e1889e7
|
|
4
|
+
data.tar.gz: 3e40f1fa2f3e718657956dfd92fbee070e1be814ea4008c502cb00e9b5e8bfe7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fddac3d7bbcaf632b27628f14d2b85ab0d614782323b45f4032c43cb5e4ec3774110a35cd8690a2479df2166c55b6d3f98a8c0efac19430e474b2495c5420207
|
|
7
|
+
data.tar.gz: 75962d891e7435e3cd17a5f910adacb3509680447763314ebd27d18d9fb7250a2ca98e7e33c60b3ed5cdcef5276f327827c52d95615b93133b6db0be8e80d4cb
|
data/README.md
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Interact with any [IDRsolutions' Microservice Examples](https://github.com/idrsolutions/) using the IDRSolutions Ruby Client.
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The IDRsolutions Microservice Examples are open source projects that allows you to
|
|
6
|
+
convert PDFs using various softwares from [IDRSolutions](https://www.idrsolutions.com/) as an online service.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
JPedal Microservice Example - Convert pages to images
|
|
9
|
+
|
|
10
|
+
BuildVu Microservice Example - Convert PDFs to HTML or SVG
|
|
11
|
+
|
|
12
|
+
FormVu Microservice Example - Convert PDF Forms to HTML
|
|
13
|
+
|
|
14
|
+
IDR Solutions offer a free trial service for running these libraries with Ruby. You can
|
|
15
|
+
find information at the following links for [JPedal](https://www.idrsolutions.com/jpedal/), [BuildVu](https://www.idrsolutions.com/buildvu/), and [FormVu](https://www.idrsolutions.com/formvu/).
|
|
8
16
|
|
|
9
17
|
-----
|
|
10
18
|
|
|
@@ -48,6 +56,10 @@ Full usage for connecting to BuildVu can be found [here](https://support.idrsolu
|
|
|
48
56
|
|
|
49
57
|
Full usage for connecting to JPedal can be found [here](https://support.idrsolutions.com/jpedal/tutorials/cloud/).
|
|
50
58
|
|
|
59
|
+
## FormVu: ##
|
|
60
|
+
|
|
61
|
+
Full usage for connecting to FormVu can be found [here](https://support.idrsolutions.com/formvu/tutorials/cloud/).
|
|
62
|
+
|
|
51
63
|
-----
|
|
52
64
|
|
|
53
65
|
# Who do I talk to? #
|
|
@@ -65,7 +77,7 @@ Short version: Don't be an awful person.
|
|
|
65
77
|
Longer version: Everyone interacting in the BuildVu Ruby Client project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
|
|
66
78
|
|
|
67
79
|
-----
|
|
68
|
-
Copyright
|
|
80
|
+
Copyright 2021 IDRsolutions
|
|
69
81
|
|
|
70
82
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
71
83
|
you may not use this file except in compliance with the License.
|
data/example_jpedal_usage.rb
CHANGED
|
@@ -7,8 +7,8 @@ client = IDRCloudClient.new('http://localhost:80/' + IDRCloudClient::JPEDAL)
|
|
|
7
7
|
conversion_results = client.convert(input: IDRCloudClient::UPLOAD, file: 'path/to/file.pdf')
|
|
8
8
|
|
|
9
9
|
# You can specify other parameters for the API as named parameters, for example
|
|
10
|
-
# here is the use of the callbackUrl parameter which is a URL that you want to
|
|
11
|
-
# be updated when the conversion finishes.
|
|
10
|
+
# here is the use of the callbackUrl parameter which is a URL that you want to
|
|
11
|
+
# be updated when the conversion finishes.
|
|
12
12
|
# See https://github.com/idrsolutions/jpedal-microservice-example/blob/master/API.md
|
|
13
13
|
#conversion_results = client.convert input: IDRCloudClient::UPLOAD, callbackUrl: 'http://listener.url'
|
|
14
14
|
|
data/lib/idr_cloud_client.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#--
|
|
2
|
-
# Copyright
|
|
2
|
+
# Copyright 2021 IDRsolutions
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -41,9 +41,9 @@ class IDRCloudClient
|
|
|
41
41
|
# Constructor, setup the converter details
|
|
42
42
|
# Params:
|
|
43
43
|
# +url+:: string, the URL of the web service.
|
|
44
|
-
# +conversion_timeout+:: int, (optional) the time to wait (in seconds) before timing out. Set to
|
|
44
|
+
# +conversion_timeout+:: int, (optional) the time to wait (in seconds) before timing out. Values <= 0 are treated as infinite. Set to -1 by default.
|
|
45
45
|
# +auth+:: array, (optional) the username and password to use for HTTP Authentication. Set to nil by default
|
|
46
|
-
def initialize(url, conversion_timeout:
|
|
46
|
+
def initialize(url, conversion_timeout: -1, auth: nil)
|
|
47
47
|
@base_endpoint = url
|
|
48
48
|
@endpoint = @base_endpoint
|
|
49
49
|
@convert_timeout = conversion_timeout
|
|
@@ -62,8 +62,12 @@ class IDRCloudClient
|
|
|
62
62
|
uuid = upload params
|
|
63
63
|
|
|
64
64
|
response = nil
|
|
65
|
+
poll_limit = @convert_timeout;
|
|
66
|
+
if poll_limit <= 0
|
|
67
|
+
poll_limit = Float::INFINITY
|
|
68
|
+
end
|
|
65
69
|
# check conversion status once every second until complete or error / timeout
|
|
66
|
-
(0
|
|
70
|
+
(0..poll_limit).each do |i|
|
|
67
71
|
sleep 1
|
|
68
72
|
response = poll_status uuid
|
|
69
73
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: idr_cloud_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- IDRsolutions
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-06-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -71,7 +71,7 @@ homepage: https://github.com/idrsolutions/idrsolutions-ruby-client
|
|
|
71
71
|
licenses:
|
|
72
72
|
- Apache-2.0
|
|
73
73
|
metadata: {}
|
|
74
|
-
post_install_message:
|
|
74
|
+
post_install_message:
|
|
75
75
|
rdoc_options: []
|
|
76
76
|
require_paths:
|
|
77
77
|
- lib
|
|
@@ -86,8 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
86
86
|
- !ruby/object:Gem::Version
|
|
87
87
|
version: '0'
|
|
88
88
|
requirements: []
|
|
89
|
-
rubygems_version: 3.0.
|
|
90
|
-
signing_key:
|
|
89
|
+
rubygems_version: 3.0.3
|
|
90
|
+
signing_key:
|
|
91
91
|
specification_version: 4
|
|
92
92
|
summary: Ruby API for IDRSolutions Microservices
|
|
93
93
|
test_files: []
|