puppet_pdf 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.rubocop.yml +17 -0
- data/.travis.yml +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +119 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/javascript/pdf.js +54 -0
- data/lib/puppet_pdf/pdf_creator.rb +29 -0
- data/lib/puppet_pdf/railtie.rb +7 -0
- data/lib/puppet_pdf/version.rb +3 -0
- data/lib/puppet_pdf.rb +10 -0
- data/lib/tasks/install_dependencies.rake +11 -0
- data/lib/utils/yarn_wrapper.rb +29 -0
- data/package.json +14 -0
- data/puppet_pdf.gemspec +31 -0
- data/yarn.lock +244 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9f0393a8dd520b7575a1f1c89720a8ada3b96bdc29d8531f307c315189f6d366
|
4
|
+
data.tar.gz: 8c2d25d907a7e91e17b3022b421385b94a0cfd2cc96f8042af065f27cad10c3b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5613503489281a6b3049c9bd8605f2f8931d3e3e34f03013e497fb35d343d4607f6a5d1474871653267f33344fcb1115817a2384ace0cfe2942edceb5b4a22f5
|
7
|
+
data.tar.gz: a5e30a5ac75a43cb58f9ce2015cf2b280eda247df86ff80006792df7f0d5119aa34f6b914cfd0572634d58024be938d0e30c7daff5a9bd0650f7d3f4f07f427d
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisplayCopNames: true
|
3
|
+
DisplayStyleGuide: true
|
4
|
+
ExtraDetails: false
|
5
|
+
TargetRubyVersion: 2.5.1
|
6
|
+
Exclude:
|
7
|
+
- 'puppet_pdf.gemspec'
|
8
|
+
- 'vendor/bundle/**/*'
|
9
|
+
|
10
|
+
Metrics/BlockLength:
|
11
|
+
ExcludedMethods: ['describe', 'context', 'feature', 'resource', 'desc']
|
12
|
+
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Style/FrozenStringLiteralComment:
|
17
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at fernandesanderson14@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
puppet_pdf (0.1.1)
|
5
|
+
activerecord
|
6
|
+
railties
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (5.2.3)
|
12
|
+
actionview (= 5.2.3)
|
13
|
+
activesupport (= 5.2.3)
|
14
|
+
rack (~> 2.0)
|
15
|
+
rack-test (>= 0.6.3)
|
16
|
+
rails-dom-testing (~> 2.0)
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
18
|
+
actionview (5.2.3)
|
19
|
+
activesupport (= 5.2.3)
|
20
|
+
builder (~> 3.1)
|
21
|
+
erubi (~> 1.4)
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
24
|
+
activemodel (5.2.3)
|
25
|
+
activesupport (= 5.2.3)
|
26
|
+
activerecord (5.2.3)
|
27
|
+
activemodel (= 5.2.3)
|
28
|
+
activesupport (= 5.2.3)
|
29
|
+
arel (>= 9.0)
|
30
|
+
activesupport (5.2.3)
|
31
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
|
+
i18n (>= 0.7, < 2)
|
33
|
+
minitest (~> 5.1)
|
34
|
+
tzinfo (~> 1.1)
|
35
|
+
arel (9.0.0)
|
36
|
+
ast (2.4.0)
|
37
|
+
builder (3.2.3)
|
38
|
+
coderay (1.1.2)
|
39
|
+
concurrent-ruby (1.1.5)
|
40
|
+
crass (1.0.4)
|
41
|
+
diff-lcs (1.3)
|
42
|
+
erubi (1.8.0)
|
43
|
+
i18n (1.6.0)
|
44
|
+
concurrent-ruby (~> 1.0)
|
45
|
+
jaro_winkler (1.5.2)
|
46
|
+
loofah (2.2.3)
|
47
|
+
crass (~> 1.0.2)
|
48
|
+
nokogiri (>= 1.5.9)
|
49
|
+
method_source (0.9.2)
|
50
|
+
mini_portile2 (2.4.0)
|
51
|
+
minitest (5.11.3)
|
52
|
+
nokogiri (1.10.3)
|
53
|
+
mini_portile2 (~> 2.4.0)
|
54
|
+
parallel (1.14.0)
|
55
|
+
parser (2.6.0.0)
|
56
|
+
ast (~> 2.4.0)
|
57
|
+
powerpack (0.1.2)
|
58
|
+
pry (0.12.2)
|
59
|
+
coderay (~> 1.1.0)
|
60
|
+
method_source (~> 0.9.0)
|
61
|
+
psych (3.1.0)
|
62
|
+
rack (2.0.7)
|
63
|
+
rack-test (1.1.0)
|
64
|
+
rack (>= 1.0, < 3)
|
65
|
+
rails-dom-testing (2.0.3)
|
66
|
+
activesupport (>= 4.2.0)
|
67
|
+
nokogiri (>= 1.6)
|
68
|
+
rails-html-sanitizer (1.0.4)
|
69
|
+
loofah (~> 2.2, >= 2.2.2)
|
70
|
+
railties (5.2.3)
|
71
|
+
actionpack (= 5.2.3)
|
72
|
+
activesupport (= 5.2.3)
|
73
|
+
method_source
|
74
|
+
rake (>= 0.8.7)
|
75
|
+
thor (>= 0.19.0, < 2.0)
|
76
|
+
rainbow (3.0.0)
|
77
|
+
rake (10.5.0)
|
78
|
+
rspec (3.8.0)
|
79
|
+
rspec-core (~> 3.8.0)
|
80
|
+
rspec-expectations (~> 3.8.0)
|
81
|
+
rspec-mocks (~> 3.8.0)
|
82
|
+
rspec-core (3.8.0)
|
83
|
+
rspec-support (~> 3.8.0)
|
84
|
+
rspec-expectations (3.8.2)
|
85
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
86
|
+
rspec-support (~> 3.8.0)
|
87
|
+
rspec-mocks (3.8.0)
|
88
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
89
|
+
rspec-support (~> 3.8.0)
|
90
|
+
rspec-support (3.8.0)
|
91
|
+
rubocop (0.65.0)
|
92
|
+
jaro_winkler (~> 1.5.1)
|
93
|
+
parallel (~> 1.10)
|
94
|
+
parser (>= 2.5, != 2.5.1.1)
|
95
|
+
powerpack (~> 0.1)
|
96
|
+
psych (>= 3.1.0)
|
97
|
+
rainbow (>= 2.2.2, < 4.0)
|
98
|
+
ruby-progressbar (~> 1.7)
|
99
|
+
unicode-display_width (~> 1.4.0)
|
100
|
+
ruby-progressbar (1.10.0)
|
101
|
+
thor (0.20.3)
|
102
|
+
thread_safe (0.3.6)
|
103
|
+
tzinfo (1.2.5)
|
104
|
+
thread_safe (~> 0.1)
|
105
|
+
unicode-display_width (1.4.1)
|
106
|
+
|
107
|
+
PLATFORMS
|
108
|
+
ruby
|
109
|
+
|
110
|
+
DEPENDENCIES
|
111
|
+
bundler (~> 1.16)
|
112
|
+
pry
|
113
|
+
puppet_pdf!
|
114
|
+
rake (~> 10.0)
|
115
|
+
rspec (~> 3.0)
|
116
|
+
rubocop
|
117
|
+
|
118
|
+
BUNDLED WITH
|
119
|
+
1.17.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Anderson Fernandes
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/andersonfernandes/puppet_pdf.svg?branch=master)](https://travis-ci.org/andersonfernandes/puppet_pdf)
|
2
|
+
|
3
|
+
# PuppetPdf
|
4
|
+
|
5
|
+
PuppetPdf is a lib that wraps [Google Puppeteer](https://pptr.dev/) pdf generation to be used with Rails.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'puppet_pdf'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install puppet_pdf
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/puppet_pdf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
38
|
+
|
39
|
+
## Code of Conduct
|
40
|
+
|
41
|
+
Everyone interacting in the PuppetPdf project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/puppet_pdf/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'puppet_pdf'
|
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/javascript/pdf.js
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const puppeteer = require('puppeteer');
|
4
|
+
const fs = require('fs')
|
5
|
+
const path = require('path')
|
6
|
+
|
7
|
+
function getCurrentTimeFormated() {
|
8
|
+
const date = new Date();
|
9
|
+
const dateFormatted = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
|
10
|
+
|
11
|
+
return `${dateFormatted}, ${date.toLocaleTimeString('en')}`
|
12
|
+
}
|
13
|
+
|
14
|
+
var access = fs.createWriteStream(path.resolve(__dirname, '/tmp/puppeteer.log'), { 'flags': 'a' });
|
15
|
+
// Redirect stdout/stderr to puppeteer.log file
|
16
|
+
process.stdout.write = process.stderr.write = access.write.bind(access);
|
17
|
+
|
18
|
+
const createPdf = async () => {
|
19
|
+
let browser;
|
20
|
+
try {
|
21
|
+
const browser = await puppeteer.launch({
|
22
|
+
headless: true,
|
23
|
+
pipe: true,
|
24
|
+
args: ['--disable-gpu', '--full-memory-crash-report', '--unlimited-storage',
|
25
|
+
'--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'],
|
26
|
+
});
|
27
|
+
const page = await browser.newPage();
|
28
|
+
await page.goto(process.argv[2], { timeout: 90000, waitUntil: 'networkidle0' });
|
29
|
+
await page.waitFor(1000);
|
30
|
+
await page.pdf({
|
31
|
+
path: process.argv[3],
|
32
|
+
format: 'A4',
|
33
|
+
margin: { top: 36, right: 36, bottom: 45, left: 36 },
|
34
|
+
displayHeaderFooter: true,
|
35
|
+
headerTemplate: "<div></div>",
|
36
|
+
footerTemplate: `
|
37
|
+
<footer style="width: 100%; font-size: 8px; font-family: Helvetica; color: #DCDCDC">
|
38
|
+
<div style="margin-left: 36px; float: left">Generated at: ${getCurrentTimeFormated()}</div>
|
39
|
+
</footer>
|
40
|
+
`
|
41
|
+
});
|
42
|
+
} catch (err) {
|
43
|
+
const formatedMessage = `\n ${err.message} at: ${getCurrentTimeFormated()}`;
|
44
|
+
access.write(formatedMessage)
|
45
|
+
} finally {
|
46
|
+
if (browser) {
|
47
|
+
browser.close();
|
48
|
+
}
|
49
|
+
process.exit();
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
createPdf();
|
54
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'tempfile'
|
2
|
+
require 'utils/yarn_wrapper'
|
3
|
+
|
4
|
+
module PuppetPdf
|
5
|
+
class PdfCreator
|
6
|
+
include ::Utils::YarnWrapper
|
7
|
+
|
8
|
+
def initialize(url, options = {})
|
9
|
+
validate_yarn_installation
|
10
|
+
|
11
|
+
@url = url
|
12
|
+
@output_path = options.fetch(:output_path, default_output_path)
|
13
|
+
end
|
14
|
+
|
15
|
+
def call
|
16
|
+
run_yarn(:createPDF, url, output_path)
|
17
|
+
output_path
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_reader :url, :output_path
|
23
|
+
|
24
|
+
def default_output_path
|
25
|
+
file = Tempfile.new(["puppet_pdf_#{Time.now.to_i}", '.pdf'])
|
26
|
+
file.path
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/puppet_pdf.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'puppet_pdf/version'
|
2
|
+
require 'puppet_pdf/pdf_creator'
|
3
|
+
require 'puppet_pdf/railtie' if defined?(Rails)
|
4
|
+
|
5
|
+
module PuppetPdf
|
6
|
+
def self.pdf_from_url(url, options = {})
|
7
|
+
pdf_creator = ::PuppetPdf::PdfCreator.new(url, options)
|
8
|
+
pdf_creator.call
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'shellwords'
|
2
|
+
|
3
|
+
module Utils
|
4
|
+
module YarnWrapper
|
5
|
+
def run_yarn(command, *args)
|
6
|
+
sh_command = <<~SH
|
7
|
+
cd #{gem_path} && yarn #{Shellwords.escape(command)} #{prepare_args(args)}
|
8
|
+
SH
|
9
|
+
system(sh_command)
|
10
|
+
end
|
11
|
+
|
12
|
+
def validate_yarn_installation
|
13
|
+
which_yarn_output = `which yarn`
|
14
|
+
|
15
|
+
raise 'Yarn not installed!' if which_yarn_output.empty?
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def gem_path
|
21
|
+
@gem_path ||=
|
22
|
+
Shellwords.escape(Gem.loaded_specs['puppet_pdf'].full_gem_path)
|
23
|
+
end
|
24
|
+
|
25
|
+
def prepare_args(args)
|
26
|
+
args.map { |arg| Shellwords.escape(arg) }.join(' ')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/package.json
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"name": "puppet_pdf",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "pdf.js",
|
5
|
+
"repository": "git@github.com:andersonfernandes/puppet_pdf.git",
|
6
|
+
"author": "Anderson Fernandes <fernandesanderson14@gmail.com>",
|
7
|
+
"license": "MIT",
|
8
|
+
"dependencies": {
|
9
|
+
"puppeteer": "^1.12.2"
|
10
|
+
},
|
11
|
+
"scripts": {
|
12
|
+
"createPDF": "node javascript/pdf.js"
|
13
|
+
}
|
14
|
+
}
|
data/puppet_pdf.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'puppet_pdf/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'puppet_pdf'
|
7
|
+
spec.version = PuppetPdf::VERSION
|
8
|
+
spec.authors = ['Anderson Fernandes']
|
9
|
+
spec.email = ['fernandesanderson14@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'Simple PDF generator based on Google Puppeteer'
|
12
|
+
spec.description = 'Simple PDF generator based on Google Puppeteer'
|
13
|
+
spec.homepage = 'https://github.com/andersonfernandes/puppet_pdf'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
17
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
end
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
24
|
+
spec.add_development_dependency 'pry'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
27
|
+
spec.add_development_dependency 'rubocop'
|
28
|
+
|
29
|
+
spec.add_dependency 'activerecord'
|
30
|
+
spec.add_dependency 'railties'
|
31
|
+
end
|
data/yarn.lock
ADDED
@@ -0,0 +1,244 @@
|
|
1
|
+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
2
|
+
# yarn lockfile v1
|
3
|
+
|
4
|
+
|
5
|
+
agent-base@^4.1.0:
|
6
|
+
version "4.2.1"
|
7
|
+
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
|
8
|
+
dependencies:
|
9
|
+
es6-promisify "^5.0.0"
|
10
|
+
|
11
|
+
async-limiter@~1.0.0:
|
12
|
+
version "1.0.0"
|
13
|
+
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
|
14
|
+
|
15
|
+
balanced-match@^1.0.0:
|
16
|
+
version "1.0.0"
|
17
|
+
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
18
|
+
|
19
|
+
brace-expansion@^1.1.7:
|
20
|
+
version "1.1.11"
|
21
|
+
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
22
|
+
dependencies:
|
23
|
+
balanced-match "^1.0.0"
|
24
|
+
concat-map "0.0.1"
|
25
|
+
|
26
|
+
buffer-from@^1.0.0:
|
27
|
+
version "1.1.1"
|
28
|
+
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
29
|
+
|
30
|
+
concat-map@0.0.1:
|
31
|
+
version "0.0.1"
|
32
|
+
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
33
|
+
|
34
|
+
concat-stream@1.6.2:
|
35
|
+
version "1.6.2"
|
36
|
+
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
|
37
|
+
dependencies:
|
38
|
+
buffer-from "^1.0.0"
|
39
|
+
inherits "^2.0.3"
|
40
|
+
readable-stream "^2.2.2"
|
41
|
+
typedarray "^0.0.6"
|
42
|
+
|
43
|
+
core-util-is@~1.0.0:
|
44
|
+
version "1.0.2"
|
45
|
+
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
46
|
+
|
47
|
+
debug@2.6.9:
|
48
|
+
version "2.6.9"
|
49
|
+
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
50
|
+
dependencies:
|
51
|
+
ms "2.0.0"
|
52
|
+
|
53
|
+
debug@^3.1.0:
|
54
|
+
version "3.2.6"
|
55
|
+
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
56
|
+
dependencies:
|
57
|
+
ms "^2.1.1"
|
58
|
+
|
59
|
+
debug@^4.1.0:
|
60
|
+
version "4.1.1"
|
61
|
+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
62
|
+
dependencies:
|
63
|
+
ms "^2.1.1"
|
64
|
+
|
65
|
+
es6-promise@^4.0.3:
|
66
|
+
version "4.2.6"
|
67
|
+
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f"
|
68
|
+
|
69
|
+
es6-promisify@^5.0.0:
|
70
|
+
version "5.0.0"
|
71
|
+
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
|
72
|
+
dependencies:
|
73
|
+
es6-promise "^4.0.3"
|
74
|
+
|
75
|
+
extract-zip@^1.6.6:
|
76
|
+
version "1.6.7"
|
77
|
+
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9"
|
78
|
+
dependencies:
|
79
|
+
concat-stream "1.6.2"
|
80
|
+
debug "2.6.9"
|
81
|
+
mkdirp "0.5.1"
|
82
|
+
yauzl "2.4.1"
|
83
|
+
|
84
|
+
fd-slicer@~1.0.1:
|
85
|
+
version "1.0.1"
|
86
|
+
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
|
87
|
+
dependencies:
|
88
|
+
pend "~1.2.0"
|
89
|
+
|
90
|
+
fs.realpath@^1.0.0:
|
91
|
+
version "1.0.0"
|
92
|
+
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
93
|
+
|
94
|
+
glob@^7.1.3:
|
95
|
+
version "7.1.3"
|
96
|
+
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
|
97
|
+
dependencies:
|
98
|
+
fs.realpath "^1.0.0"
|
99
|
+
inflight "^1.0.4"
|
100
|
+
inherits "2"
|
101
|
+
minimatch "^3.0.4"
|
102
|
+
once "^1.3.0"
|
103
|
+
path-is-absolute "^1.0.0"
|
104
|
+
|
105
|
+
https-proxy-agent@^2.2.1:
|
106
|
+
version "2.2.1"
|
107
|
+
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
|
108
|
+
dependencies:
|
109
|
+
agent-base "^4.1.0"
|
110
|
+
debug "^3.1.0"
|
111
|
+
|
112
|
+
inflight@^1.0.4:
|
113
|
+
version "1.0.6"
|
114
|
+
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
115
|
+
dependencies:
|
116
|
+
once "^1.3.0"
|
117
|
+
wrappy "1"
|
118
|
+
|
119
|
+
inherits@2, inherits@^2.0.3, inherits@~2.0.3:
|
120
|
+
version "2.0.3"
|
121
|
+
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
122
|
+
|
123
|
+
isarray@~1.0.0:
|
124
|
+
version "1.0.0"
|
125
|
+
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
126
|
+
|
127
|
+
mime@^2.0.3:
|
128
|
+
version "2.4.0"
|
129
|
+
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6"
|
130
|
+
|
131
|
+
minimatch@^3.0.4:
|
132
|
+
version "3.0.4"
|
133
|
+
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
134
|
+
dependencies:
|
135
|
+
brace-expansion "^1.1.7"
|
136
|
+
|
137
|
+
minimist@0.0.8:
|
138
|
+
version "0.0.8"
|
139
|
+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
140
|
+
|
141
|
+
mkdirp@0.5.1:
|
142
|
+
version "0.5.1"
|
143
|
+
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
144
|
+
dependencies:
|
145
|
+
minimist "0.0.8"
|
146
|
+
|
147
|
+
ms@2.0.0:
|
148
|
+
version "2.0.0"
|
149
|
+
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
150
|
+
|
151
|
+
ms@^2.1.1:
|
152
|
+
version "2.1.1"
|
153
|
+
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
154
|
+
|
155
|
+
once@^1.3.0:
|
156
|
+
version "1.4.0"
|
157
|
+
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
158
|
+
dependencies:
|
159
|
+
wrappy "1"
|
160
|
+
|
161
|
+
path-is-absolute@^1.0.0:
|
162
|
+
version "1.0.1"
|
163
|
+
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
164
|
+
|
165
|
+
pend@~1.2.0:
|
166
|
+
version "1.2.0"
|
167
|
+
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
|
168
|
+
|
169
|
+
process-nextick-args@~2.0.0:
|
170
|
+
version "2.0.0"
|
171
|
+
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
|
172
|
+
|
173
|
+
progress@^2.0.1:
|
174
|
+
version "2.0.3"
|
175
|
+
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
|
176
|
+
|
177
|
+
proxy-from-env@^1.0.0:
|
178
|
+
version "1.0.0"
|
179
|
+
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee"
|
180
|
+
|
181
|
+
puppeteer@^1.12.2:
|
182
|
+
version "1.12.2"
|
183
|
+
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.12.2.tgz#dbc36afc3ba2d7182b1a37523c0081a0e8507c9a"
|
184
|
+
dependencies:
|
185
|
+
debug "^4.1.0"
|
186
|
+
extract-zip "^1.6.6"
|
187
|
+
https-proxy-agent "^2.2.1"
|
188
|
+
mime "^2.0.3"
|
189
|
+
progress "^2.0.1"
|
190
|
+
proxy-from-env "^1.0.0"
|
191
|
+
rimraf "^2.6.1"
|
192
|
+
ws "^6.1.0"
|
193
|
+
|
194
|
+
readable-stream@^2.2.2:
|
195
|
+
version "2.3.6"
|
196
|
+
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
|
197
|
+
dependencies:
|
198
|
+
core-util-is "~1.0.0"
|
199
|
+
inherits "~2.0.3"
|
200
|
+
isarray "~1.0.0"
|
201
|
+
process-nextick-args "~2.0.0"
|
202
|
+
safe-buffer "~5.1.1"
|
203
|
+
string_decoder "~1.1.1"
|
204
|
+
util-deprecate "~1.0.1"
|
205
|
+
|
206
|
+
rimraf@^2.6.1:
|
207
|
+
version "2.6.3"
|
208
|
+
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
|
209
|
+
dependencies:
|
210
|
+
glob "^7.1.3"
|
211
|
+
|
212
|
+
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
213
|
+
version "5.1.2"
|
214
|
+
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
215
|
+
|
216
|
+
string_decoder@~1.1.1:
|
217
|
+
version "1.1.1"
|
218
|
+
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
219
|
+
dependencies:
|
220
|
+
safe-buffer "~5.1.0"
|
221
|
+
|
222
|
+
typedarray@^0.0.6:
|
223
|
+
version "0.0.6"
|
224
|
+
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
225
|
+
|
226
|
+
util-deprecate@~1.0.1:
|
227
|
+
version "1.0.2"
|
228
|
+
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
229
|
+
|
230
|
+
wrappy@1:
|
231
|
+
version "1.0.2"
|
232
|
+
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
233
|
+
|
234
|
+
ws@^6.1.0:
|
235
|
+
version "6.1.4"
|
236
|
+
resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.4.tgz#5b5c8800afab925e94ccb29d153c8d02c1776ef9"
|
237
|
+
dependencies:
|
238
|
+
async-limiter "~1.0.0"
|
239
|
+
|
240
|
+
yauzl@2.4.1:
|
241
|
+
version "2.4.1"
|
242
|
+
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
|
243
|
+
dependencies:
|
244
|
+
fd-slicer "~1.0.1"
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: puppet_pdf
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Anderson Fernandes
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-07-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activerecord
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: railties
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Simple PDF generator based on Google Puppeteer
|
112
|
+
email:
|
113
|
+
- fernandesanderson14@gmail.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- ".travis.yml"
|
122
|
+
- CODE_OF_CONDUCT.md
|
123
|
+
- Gemfile
|
124
|
+
- Gemfile.lock
|
125
|
+
- LICENSE.txt
|
126
|
+
- README.md
|
127
|
+
- Rakefile
|
128
|
+
- bin/console
|
129
|
+
- bin/setup
|
130
|
+
- javascript/pdf.js
|
131
|
+
- lib/puppet_pdf.rb
|
132
|
+
- lib/puppet_pdf/pdf_creator.rb
|
133
|
+
- lib/puppet_pdf/railtie.rb
|
134
|
+
- lib/puppet_pdf/version.rb
|
135
|
+
- lib/tasks/install_dependencies.rake
|
136
|
+
- lib/utils/yarn_wrapper.rb
|
137
|
+
- package.json
|
138
|
+
- puppet_pdf.gemspec
|
139
|
+
- yarn.lock
|
140
|
+
homepage: https://github.com/andersonfernandes/puppet_pdf
|
141
|
+
licenses:
|
142
|
+
- MIT
|
143
|
+
metadata: {}
|
144
|
+
post_install_message:
|
145
|
+
rdoc_options: []
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
requirements: []
|
159
|
+
rubygems_version: 3.0.3
|
160
|
+
signing_key:
|
161
|
+
specification_version: 4
|
162
|
+
summary: Simple PDF generator based on Google Puppeteer
|
163
|
+
test_files: []
|