pdf-rendering-srv-ruby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ruby.yml +30 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +6 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +173 -0
- data/README.md +52 -0
- data/Rakefile +12 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lefthook.yml +5 -0
- data/lib/pdf_rendering_srv.rb +27 -0
- data/lib/pdf_rendering_srv/base.rb +108 -0
- data/lib/pdf_rendering_srv/configuration.rb +11 -0
- data/lib/pdf_rendering_srv/from_html.rb +14 -0
- data/lib/pdf_rendering_srv/from_url.rb +14 -0
- data/lib/pdf_rendering_srv/version.rb +5 -0
- data/pdf-rendering-srv-ruby.gemspec +41 -0
- metadata +230 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 93a52c63e0f48cf942e132fef78d222f24adadbd83ae52cca3613d2e1114a672
|
4
|
+
data.tar.gz: 6844187efd9ee3bbe3591f2d2cda8a7f16cc512886cc813753da9b58d8e4b4a6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a2a318a0f63038ab977976c7d1a38ce1b129d9b2238ca94a8bd2b039b2b22f6c358ff873397eaffefb3539c84073cb87f6e2d09eb60b611ea451bfce3acf108b
|
7
|
+
data.tar.gz: 989f5495a1aacc474fd49e58c5005672dde43228b4b7f80ab30f1a9d84b1e07421942c3fef6d89361b6dd67d7cac5c718a70d66676b919d8a15cecd15f274830
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ '**' ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ '**' ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: 2.7.2
|
27
|
+
- name: Install dependencies
|
28
|
+
run: bundle install
|
29
|
+
- name: Run tests
|
30
|
+
run: bundle exec rake
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.2
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pdf-rendering-srv-ruby (0.1.0)
|
5
|
+
dry-struct (~> 1.3)
|
6
|
+
dry-types (~> 1.4)
|
7
|
+
http (~> 4.4)
|
8
|
+
zeitwerk (~> 2.4)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
actionpack (6.1.3.1)
|
14
|
+
actionview (= 6.1.3.1)
|
15
|
+
activesupport (= 6.1.3.1)
|
16
|
+
rack (~> 2.0, >= 2.0.9)
|
17
|
+
rack-test (>= 0.6.3)
|
18
|
+
rails-dom-testing (~> 2.0)
|
19
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
20
|
+
actionview (6.1.3.1)
|
21
|
+
activesupport (= 6.1.3.1)
|
22
|
+
builder (~> 3.1)
|
23
|
+
erubi (~> 1.4)
|
24
|
+
rails-dom-testing (~> 2.0)
|
25
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
26
|
+
activesupport (6.1.3.1)
|
27
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
28
|
+
i18n (>= 1.6, < 2)
|
29
|
+
minitest (>= 5.1)
|
30
|
+
tzinfo (~> 2.0)
|
31
|
+
zeitwerk (~> 2.3)
|
32
|
+
addressable (2.7.0)
|
33
|
+
public_suffix (>= 2.0.2, < 5.0)
|
34
|
+
ast (2.4.2)
|
35
|
+
builder (3.2.4)
|
36
|
+
concurrent-ruby (1.1.8)
|
37
|
+
crack (0.4.5)
|
38
|
+
rexml
|
39
|
+
crass (1.0.6)
|
40
|
+
domain_name (0.5.20190701)
|
41
|
+
unf (>= 0.0.5, < 1.0.0)
|
42
|
+
dry-configurable (0.12.1)
|
43
|
+
concurrent-ruby (~> 1.0)
|
44
|
+
dry-core (~> 0.5, >= 0.5.0)
|
45
|
+
dry-container (0.7.2)
|
46
|
+
concurrent-ruby (~> 1.0)
|
47
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
48
|
+
dry-core (0.5.0)
|
49
|
+
concurrent-ruby (~> 1.0)
|
50
|
+
dry-inflector (0.2.0)
|
51
|
+
dry-logic (1.2.0)
|
52
|
+
concurrent-ruby (~> 1.0)
|
53
|
+
dry-core (~> 0.5, >= 0.5)
|
54
|
+
dry-struct (1.4.0)
|
55
|
+
dry-core (~> 0.5, >= 0.5)
|
56
|
+
dry-types (~> 1.5)
|
57
|
+
ice_nine (~> 0.11)
|
58
|
+
dry-types (1.5.1)
|
59
|
+
concurrent-ruby (~> 1.0)
|
60
|
+
dry-container (~> 0.3)
|
61
|
+
dry-core (~> 0.5, >= 0.5)
|
62
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
63
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
64
|
+
erubi (1.10.0)
|
65
|
+
ffi (1.15.0)
|
66
|
+
ffi-compiler (1.0.1)
|
67
|
+
ffi (>= 1.0.0)
|
68
|
+
rake
|
69
|
+
hashdiff (1.0.1)
|
70
|
+
http (4.4.1)
|
71
|
+
addressable (~> 2.3)
|
72
|
+
http-cookie (~> 1.0)
|
73
|
+
http-form_data (~> 2.2)
|
74
|
+
http-parser (~> 1.2.0)
|
75
|
+
http-cookie (1.0.3)
|
76
|
+
domain_name (~> 0.5)
|
77
|
+
http-form_data (2.3.0)
|
78
|
+
http-parser (1.2.3)
|
79
|
+
ffi-compiler (>= 1.0, < 2.0)
|
80
|
+
i18n (1.8.10)
|
81
|
+
concurrent-ruby (~> 1.0)
|
82
|
+
ice_nine (0.11.2)
|
83
|
+
lefthook (0.7.4)
|
84
|
+
loofah (2.9.1)
|
85
|
+
crass (~> 1.0.2)
|
86
|
+
nokogiri (>= 1.5.9)
|
87
|
+
method_source (1.0.0)
|
88
|
+
mini_portile2 (2.5.1)
|
89
|
+
minitest (5.14.4)
|
90
|
+
nokogiri (1.11.3)
|
91
|
+
mini_portile2 (~> 2.5.0)
|
92
|
+
racc (~> 1.4)
|
93
|
+
parallel (1.20.1)
|
94
|
+
parser (3.0.1.0)
|
95
|
+
ast (~> 2.4.1)
|
96
|
+
public_suffix (4.0.6)
|
97
|
+
racc (1.5.2)
|
98
|
+
rack (2.2.3)
|
99
|
+
rack-test (1.1.0)
|
100
|
+
rack (>= 1.0, < 3)
|
101
|
+
rails-dom-testing (2.0.3)
|
102
|
+
activesupport (>= 4.2.0)
|
103
|
+
nokogiri (>= 1.6)
|
104
|
+
rails-html-sanitizer (1.3.0)
|
105
|
+
loofah (~> 2.3)
|
106
|
+
railties (6.1.3.1)
|
107
|
+
actionpack (= 6.1.3.1)
|
108
|
+
activesupport (= 6.1.3.1)
|
109
|
+
method_source
|
110
|
+
rake (>= 0.8.7)
|
111
|
+
thor (~> 1.0)
|
112
|
+
rainbow (3.0.0)
|
113
|
+
rake (10.5.0)
|
114
|
+
regexp_parser (2.1.1)
|
115
|
+
rexml (3.2.5)
|
116
|
+
rubocop (1.13.0)
|
117
|
+
parallel (~> 1.10)
|
118
|
+
parser (>= 3.0.0.0)
|
119
|
+
rainbow (>= 2.2.2, < 4.0)
|
120
|
+
regexp_parser (>= 1.8, < 3.0)
|
121
|
+
rexml
|
122
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
123
|
+
ruby-progressbar (~> 1.7)
|
124
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
125
|
+
rubocop-ast (1.4.1)
|
126
|
+
parser (>= 2.7.1.5)
|
127
|
+
rubocop-packaging (0.5.1)
|
128
|
+
rubocop (>= 0.89, < 2.0)
|
129
|
+
rubocop-performance (1.11.1)
|
130
|
+
rubocop (>= 1.7.0, < 2.0)
|
131
|
+
rubocop-ast (>= 0.4.0)
|
132
|
+
rubocop-rails (2.9.1)
|
133
|
+
activesupport (>= 4.2.0)
|
134
|
+
rack (>= 1.1)
|
135
|
+
rubocop (>= 0.90.0, < 2.0)
|
136
|
+
rubocop-rails_config (1.5.2)
|
137
|
+
railties (>= 5.0)
|
138
|
+
rubocop (>= 1.13)
|
139
|
+
rubocop-ast (>= 1.0.1)
|
140
|
+
rubocop-packaging (~> 0.5)
|
141
|
+
rubocop-performance (~> 1.11)
|
142
|
+
rubocop-rails (~> 2.0)
|
143
|
+
ruby-progressbar (1.11.0)
|
144
|
+
thor (1.1.0)
|
145
|
+
tzinfo (2.0.4)
|
146
|
+
concurrent-ruby (~> 1.0)
|
147
|
+
unf (0.1.4)
|
148
|
+
unf_ext
|
149
|
+
unf_ext (0.0.7.7)
|
150
|
+
unicode-display_width (2.0.0)
|
151
|
+
vcr (6.0.0)
|
152
|
+
webmock (3.12.2)
|
153
|
+
addressable (>= 2.3.6)
|
154
|
+
crack (>= 0.3.2)
|
155
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
156
|
+
zeitwerk (2.4.2)
|
157
|
+
|
158
|
+
PLATFORMS
|
159
|
+
ruby
|
160
|
+
|
161
|
+
DEPENDENCIES
|
162
|
+
activesupport (~> 6.0)
|
163
|
+
bundler
|
164
|
+
lefthook
|
165
|
+
minitest (~> 5.0)
|
166
|
+
pdf-rendering-srv-ruby!
|
167
|
+
rake (~> 10.0)
|
168
|
+
rubocop-rails_config
|
169
|
+
vcr (~> 6.0)
|
170
|
+
webmock (~> 3.9)
|
171
|
+
|
172
|
+
BUNDLED WITH
|
173
|
+
2.1.4
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# pdf-rendering-srv-ruby
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/pdf-rendering-srv-ruby.svg)](https://rubygems.org/gems/pdf-rendering-srv-ruby)
|
4
|
+
![Ruby](https://github.com/tomasc/pdf-rendering-srv-ruby/workflows/Ruby/badge.svg)
|
5
|
+
|
6
|
+
Simple Ruby wrapper for seding requests to [pdf-rendering-srv](https://github.com/restorecommerce/pdf-rendering-srv)
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'pdf-rendering-srv-ruby'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install pdf-rendering-srv-ruby
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
Configure the gem by specifying URL of the [pdf-rendering-srv](https://github.com/restorecommerce/pdf-rendering-srv) service:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
PdfRenderingSrv.configure do |config|
|
30
|
+
config.pdf_rendering_srv_url = "http://localhost:9000/api/render" # default value
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
PdfRenderingSrv::FromUrl.call(url: "https://example.com", format: :png, viewport: { width: 800 })
|
36
|
+
```
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
PdfRenderingSrv::FromHtml.call(html: "<html><head><title>Example</title></head><body>", format: :pdf, pdf: { format: "A4" })
|
40
|
+
```
|
41
|
+
|
42
|
+
The general interface is described in the [Base](/pdf-rendering-srv/base.rb) class.
|
43
|
+
|
44
|
+
## Development
|
45
|
+
|
46
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
47
|
+
|
48
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/tomasc/pdf-rendering-srv-ruby.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "pdf/rendering/srv/ruby"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lefthook.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pdf_rendering_srv/version"
|
4
|
+
|
5
|
+
require "active_support/core_ext/hash"
|
6
|
+
|
7
|
+
require "dry-struct"
|
8
|
+
require "dry-types"
|
9
|
+
require "http"
|
10
|
+
require "zeitwerk"
|
11
|
+
|
12
|
+
module PdfRenderingSrv
|
13
|
+
class << self
|
14
|
+
def configuration
|
15
|
+
@configuration ||= Configuration.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def configure
|
19
|
+
yield(configuration)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
Zeitwerk::Loader.new.tap do |loader|
|
25
|
+
loader.push_dir("#{__dir__}/pdf_rendering_srv", namespace: PdfRenderingSrv)
|
26
|
+
loader.setup
|
27
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PdfRenderingSrv
|
4
|
+
class Base < Dry::Struct
|
5
|
+
module Types
|
6
|
+
include Dry.Types()
|
7
|
+
end
|
8
|
+
|
9
|
+
attribute :pdf_rendering_srv_url, Types::String.optional.default(PdfRenderingSrv.configuration.pdf_rendering_srv_url.freeze)
|
10
|
+
|
11
|
+
attribute :format, Types::Coercible::Symbol.enum(*%i[html pdf png jpg jpeg]).optional.default(:pdf)
|
12
|
+
attribute :jpeg_quality, Types::Coercible::Integer.optional.default(90)
|
13
|
+
|
14
|
+
# @see https://github.com/alvarcarto/url-to-pdf-api#get-apirender
|
15
|
+
|
16
|
+
attribute :emulate_screen_media, Types::Bool.optional.default(nil)
|
17
|
+
attribute :scroll_page, Types::Bool.optional.default(nil)
|
18
|
+
attribute :wait_for, Types::Coercible::String.optional.default(nil)
|
19
|
+
|
20
|
+
attribute? :viewport do
|
21
|
+
attribute :width, Types::Coercible::Integer.optional.default(nil)
|
22
|
+
attribute :height, Types::Coercible::Integer.optional.default(nil)
|
23
|
+
attribute :device_scale_factor, Types::Coercible::Integer.optional.default(2)
|
24
|
+
attribute :is_mobile, Types::Bool.optional.default(nil)
|
25
|
+
attribute :has_touch, Types::Bool.optional.default(nil)
|
26
|
+
attribute :is_landscape, Types::Bool.optional.default(nil)
|
27
|
+
end
|
28
|
+
|
29
|
+
attribute? :goto do
|
30
|
+
attribute :wait_until, Types::Coercible::String.enum(*%w[load networkidle0 networkidle2]).optional.default(nil)
|
31
|
+
attribute :network_idle_timeout, Types::Integer.optional.default(nil)
|
32
|
+
end
|
33
|
+
|
34
|
+
attribute? :pdf do
|
35
|
+
attribute :scale, Types::Coercible::Float.optional.default(nil)
|
36
|
+
attribute :print_background, Types::Bool.optional.default(nil)
|
37
|
+
attribute :landscape, Types::Bool.optional.default(nil)
|
38
|
+
attribute :page_ranges, Types::Coercible::String.optional.default(nil)
|
39
|
+
attribute :format, Types::Coercible::String.optional.default(nil)
|
40
|
+
attribute :width, Types::Coercible::String.optional.default(nil)
|
41
|
+
attribute :height, Types::Coercible::String.optional.default(nil)
|
42
|
+
attribute :margin_top, Types::Coercible::String.optional.default(nil)
|
43
|
+
attribute :margin_right, Types::Coercible::String.optional.default(nil)
|
44
|
+
attribute :margin_bottom, Types::Coercible::String.optional.default(nil)
|
45
|
+
attribute :margin_left, Types::Coercible::String.optional.default(nil)
|
46
|
+
end
|
47
|
+
|
48
|
+
attribute? :screenshot do
|
49
|
+
attribute :full_page, Types::Bool.optional.default(nil)
|
50
|
+
attribute :omit_background, Types::Bool.optional.default(nil)
|
51
|
+
attribute :clip_x, Types::Coercible::Integer.optional.default(nil)
|
52
|
+
attribute :clip_y, Types::Coercible::Integer.optional.default(nil)
|
53
|
+
attribute :clip_width, Types::Coercible::Integer.optional.default(nil)
|
54
|
+
attribute :clip_height, Types::Coercible::Integer.optional.default(nil)
|
55
|
+
attribute :selector, Types::Coercible::String.optional.default(nil)
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.call(*args)
|
59
|
+
new(*args).response
|
60
|
+
end
|
61
|
+
|
62
|
+
def response
|
63
|
+
raise NotImplementedError
|
64
|
+
end
|
65
|
+
|
66
|
+
def params
|
67
|
+
to_h.except(*%i[format jpeg_quality pdf_rendering_srv_url]).deep_merge(
|
68
|
+
output: output,
|
69
|
+
screenshot: {
|
70
|
+
type: screenshot_type,
|
71
|
+
quality: screenshot_quality
|
72
|
+
}
|
73
|
+
).deep_transform_keys { |k| k.to_s.camelcase.tap { |str| str[0] = str[0].downcase }.to_sym }
|
74
|
+
.reject { |_, v| v.nil? }
|
75
|
+
.transform_values do |v|
|
76
|
+
case v
|
77
|
+
when Hash then v.reject { |_, val| val.nil? }
|
78
|
+
else v
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
private
|
84
|
+
def output
|
85
|
+
case format
|
86
|
+
when :html then :html
|
87
|
+
when :pdf then :pdf
|
88
|
+
when :png, :jpg, :jpeg then :screenshot
|
89
|
+
else nil
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def screenshot_type
|
94
|
+
case format
|
95
|
+
when :png then :png
|
96
|
+
when :jpg, :jpeg then :jpeg
|
97
|
+
else nil
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def screenshot_quality
|
102
|
+
case format
|
103
|
+
when :jpg, :jpeg then jpeg_quality
|
104
|
+
else nil
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "http"
|
4
|
+
|
5
|
+
module PdfRenderingSrv
|
6
|
+
class FromHtml < Base
|
7
|
+
attribute :html, Types::Coercible::String
|
8
|
+
|
9
|
+
def response
|
10
|
+
@response ||= HTTP.headers("content-type" => "text/html")
|
11
|
+
.post(pdf_rendering_srv_url, body: html, json: params)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "http"
|
4
|
+
|
5
|
+
module PdfRenderingSrv
|
6
|
+
class FromUrl < Base
|
7
|
+
attribute :url, Types::Coercible::String
|
8
|
+
|
9
|
+
def response
|
10
|
+
@response ||= HTTP.headers("content-type" => "application/json")
|
11
|
+
.post(pdf_rendering_srv_url, json: params.merge(url: url))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "pdf_rendering_srv/version"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "pdf-rendering-srv-ruby"
|
9
|
+
spec.version = PdfRenderingSrv::VERSION
|
10
|
+
spec.authors = ["Tomas Celizna"]
|
11
|
+
spec.email = ["mail@tomascelizna.com"]
|
12
|
+
|
13
|
+
spec.summary = "Simple Ruby wrapper for seding requests to pdf-rendering-srv."
|
14
|
+
spec.homepage = "https://github.com/tomasc/pdf-rendering-srv-ruby"
|
15
|
+
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
end
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_dependency "dry-struct", "~> 1.3"
|
26
|
+
spec.add_dependency "dry-types", "~> 1.4"
|
27
|
+
spec.add_dependency "http", "~> 4.4"
|
28
|
+
spec.add_dependency "zeitwerk", "~> 2.4"
|
29
|
+
|
30
|
+
spec.add_development_dependency "activesupport", "~> 6.0"
|
31
|
+
|
32
|
+
spec.add_development_dependency "vcr", "~> 6.0"
|
33
|
+
spec.add_development_dependency "webmock", "~> 3.9"
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
38
|
+
|
39
|
+
spec.add_development_dependency "lefthook"
|
40
|
+
spec.add_development_dependency "rubocop-rails_config"
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,230 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pdf-rendering-srv-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tomas Celizna
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-05-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dry-struct
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dry-types
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: http
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.4'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: zeitwerk
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.4'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activesupport
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '6.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '6.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '6.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '6.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.9'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.9'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: bundler
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rake
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '10.0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '10.0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: minitest
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '5.0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '5.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: lefthook
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rubocop-rails_config
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
description:
|
182
|
+
email:
|
183
|
+
- mail@tomascelizna.com
|
184
|
+
executables: []
|
185
|
+
extensions: []
|
186
|
+
extra_rdoc_files: []
|
187
|
+
files:
|
188
|
+
- ".github/workflows/ruby.yml"
|
189
|
+
- ".gitignore"
|
190
|
+
- ".rubocop.yml"
|
191
|
+
- ".ruby-version"
|
192
|
+
- ".travis.yml"
|
193
|
+
- CHANGELOG.md
|
194
|
+
- Gemfile
|
195
|
+
- Gemfile.lock
|
196
|
+
- README.md
|
197
|
+
- Rakefile
|
198
|
+
- bin/console
|
199
|
+
- bin/setup
|
200
|
+
- lefthook.yml
|
201
|
+
- lib/pdf_rendering_srv.rb
|
202
|
+
- lib/pdf_rendering_srv/base.rb
|
203
|
+
- lib/pdf_rendering_srv/configuration.rb
|
204
|
+
- lib/pdf_rendering_srv/from_html.rb
|
205
|
+
- lib/pdf_rendering_srv/from_url.rb
|
206
|
+
- lib/pdf_rendering_srv/version.rb
|
207
|
+
- pdf-rendering-srv-ruby.gemspec
|
208
|
+
homepage: https://github.com/tomasc/pdf-rendering-srv-ruby
|
209
|
+
licenses: []
|
210
|
+
metadata: {}
|
211
|
+
post_install_message:
|
212
|
+
rdoc_options: []
|
213
|
+
require_paths:
|
214
|
+
- lib
|
215
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - ">="
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '0'
|
220
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
|
+
requirements:
|
222
|
+
- - ">="
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
version: '0'
|
225
|
+
requirements: []
|
226
|
+
rubygems_version: 3.1.4
|
227
|
+
signing_key:
|
228
|
+
specification_version: 4
|
229
|
+
summary: Simple Ruby wrapper for seding requests to pdf-rendering-srv.
|
230
|
+
test_files: []
|