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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da0936841c444cd5042a95b24eebd9e83cd10d429a67e5d2f07c01d37869e7d
4
- data.tar.gz: c9e6be8fb2467427e39d80e0f60218491897087cc9ac8a4d42c969c2c5944e11
3
+ metadata.gz: 7635c8ce9db27c8f016e8ca28339297a9b6bd712ea64c4b1248fa6238110115e
4
+ data.tar.gz: e1b99349e9a8f301d10a4217e66ccbac5e61e1339e8e6d35f5dd70ec6691863a
5
5
  SHA512:
6
- metadata.gz: 7ec7ee8b7e2aedd8bce59fba98f644d27a17f21e0039b2265f80ddf05901f1a12db19e422e534f29c44019deb25a213adb268c14a6cf7597ae8f5aa433f63577
7
- data.tar.gz: 814b7939bc6c3725c5f0c7d3081fcac99bc5d42e5809c687cae5d0c56365f9cc134c9a678b43c30b527dfcca008024b7d14202db262861f12687403223d0f23e
6
+ metadata.gz: c5bf6145bf1afd519b22a87963301a118771ddaa4ceff0607fcbdcc64021f6446205a3cf349a67d053550d239e750793aa961a2da79c1e60b0585b9405927277
7
+ data.tar.gz: ee10527bbd316e83539a3cbb0014216bac678d25fffd6f36cce66c391ff8da6bab960dedeb0d2541ca1b1fcd0e236b80a9398f63b048203c2a49f004814e0eee
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ *.gem
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
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
- $ docker run --rm -p 3000:3000 gotenberg/gotenberg:7
12
-
11
+ ```
12
+ docker run --rm -p 3000:3000 gotenberg/gotenberg:7
13
+ ```
13
14
 
14
15
  install gotenberg-client gem
15
16
 
16
- $ gem install gotenberg-client
17
+ ```
18
+ gem install gotenberg-client
19
+ ```
17
20
 
18
21
  or add gotenberg-client to your gemfile
19
22
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gotenberg
4
- VERSION = "0.1.1.5"
4
+ VERSION = "0.1.1.9"
5
5
  end
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
- conn = Faraday.new(url) do |f|
47
- f.request :multipart, flat_encode: true
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.5
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-26 00:00:00.000000000 Z
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
Binary file
Binary file
Binary file
data/gotenberg-0.1.1.gem DELETED
Binary file
Binary file