gotenberg-client 0.1.1.5 → 0.1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +6 -3
- data/lib/gotenberg/version.rb +1 -1
- data/lib/gotenberg.rb +16 -4
- metadata +2 -8
- data/gotenberg-0.1.0.gem +0 -0
- data/gotenberg-0.1.1.1.gem +0 -0
- data/gotenberg-0.1.1.2.gem +0 -0
- data/gotenberg-0.1.1.3.gem +0 -0
- data/gotenberg-0.1.1.gem +0 -0
- data/gotenberg-client-0.1.1.3.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7635c8ce9db27c8f016e8ca28339297a9b6bd712ea64c4b1248fa6238110115e
|
4
|
+
data.tar.gz: e1b99349e9a8f301d10a4217e66ccbac5e61e1339e8e6d35f5dd70ec6691863a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5bf6145bf1afd519b22a87963301a118771ddaa4ceff0607fcbdcc64021f6446205a3cf349a67d053550d239e750793aa961a2da79c1e60b0585b9405927277
|
7
|
+
data.tar.gz: ee10527bbd316e83539a3cbb0014216bac678d25fffd6f36cce66c391ff8da6bab960dedeb0d2541ca1b1fcd0e236b80a9398f63b048203c2a49f004814e0eee
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -8,12 +8,15 @@ this gem is young and needs a lot of updates and improvements. (work in progress
|
|
8
8
|
## install
|
9
9
|
First download and run gotenberg
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
```
|
12
|
+
docker run --rm -p 3000:3000 gotenberg/gotenberg:7
|
13
|
+
```
|
13
14
|
|
14
15
|
install gotenberg-client gem
|
15
16
|
|
16
|
-
|
17
|
+
```
|
18
|
+
gem install gotenberg-client
|
19
|
+
```
|
17
20
|
|
18
21
|
or add gotenberg-client to your gemfile
|
19
22
|
|
data/lib/gotenberg/version.rb
CHANGED
data/lib/gotenberg.rb
CHANGED
@@ -12,6 +12,14 @@ require_relative "gotenberg/version"
|
|
12
12
|
module Gotenberg
|
13
13
|
class Error < StandardError; end
|
14
14
|
# Your code goes here...
|
15
|
+
|
16
|
+
class Assets
|
17
|
+
def self.include_css(file)
|
18
|
+
raise "Not in Rails project" unless !Rails.nil?
|
19
|
+
abs_path = Rails.root.join('public', 'stylesheets',file)
|
20
|
+
return "<style type='text/css'>#{File.read(abs_path)}</style>".html_safe
|
21
|
+
end
|
22
|
+
end
|
15
23
|
class Client
|
16
24
|
def initialize(api_url)
|
17
25
|
@api_url = api_url
|
@@ -42,13 +50,17 @@ module Gotenberg
|
|
42
50
|
)
|
43
51
|
}
|
44
52
|
url= "#{@api_url}/forms/chromium/convert/html"
|
53
|
+
begin
|
54
|
+
conn = Faraday.new(url) do |f|
|
55
|
+
f.request :multipart, flat_encode: true
|
56
|
+
f.adapter :net_http
|
57
|
+
end
|
58
|
+
response = conn.post(url, payload)
|
45
59
|
|
46
|
-
|
47
|
-
|
48
|
-
f.adapter :net_http
|
60
|
+
rescue StandardError => e
|
61
|
+
response=""
|
49
62
|
end
|
50
63
|
|
51
|
-
response = conn.post(url, payload)
|
52
64
|
ind_html.close
|
53
65
|
ind_html.unlink
|
54
66
|
output.write(response.body.force_encoding("utf-8"))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gotenberg-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jean-christophe bauduin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -55,12 +55,6 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- bin/console
|
57
57
|
- bin/setup
|
58
|
-
- gotenberg-0.1.0.gem
|
59
|
-
- gotenberg-0.1.1.1.gem
|
60
|
-
- gotenberg-0.1.1.2.gem
|
61
|
-
- gotenberg-0.1.1.3.gem
|
62
|
-
- gotenberg-0.1.1.gem
|
63
|
-
- gotenberg-client-0.1.1.3.gem
|
64
58
|
- gotenberg.gemspec
|
65
59
|
- lib/gotenberg.rb
|
66
60
|
- lib/gotenberg/version.rb
|
data/gotenberg-0.1.0.gem
DELETED
Binary file
|
data/gotenberg-0.1.1.1.gem
DELETED
Binary file
|
data/gotenberg-0.1.1.2.gem
DELETED
Binary file
|
data/gotenberg-0.1.1.3.gem
DELETED
Binary file
|
data/gotenberg-0.1.1.gem
DELETED
Binary file
|
Binary file
|