weasy_pdf 0.1.0 → 0.1.1
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/CHANGELOG.md +11 -0
- data/README.md +8 -2
- data/lib/generators/weasy_pdf/install_generator.rb +16 -0
- data/lib/generators/weasy_pdf/templates/weasy_pdf.rb +25 -0
- data/lib/weasy_pdf/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12b1d3cf6d3b8596b9ab9e5873d05dbc29ebff24966de276e0cc5d234247273d
|
|
4
|
+
data.tar.gz: 1df1d355f3a8b52074edaf604370025df78d8e93bb30a7ec88fd4ad1fa870827
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f25f4b0d192f1fbe9b0e96aa140488eaad532ea552691c24565e1753810d40a6a3d3423235bf57228542635616b5066bf952c13dec6aa3b93851402485c3dc58
|
|
7
|
+
data.tar.gz: 3dd91e7e0bab4f2bebe6817c0cc192b1aaff5347b565287a2b126d491c2d74d96f6ce09eab0f5129b074c67f00a643a5f42d04c14375060316221ebe46d17714
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.1] - 2026-04-18
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `rails generate weasy_pdf:install` generator — scaffolds `config/initializers/weasy_pdf.rb` with all options documented
|
|
15
|
+
- Status badges in README (gem version, build status, license, Ruby version)
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- CI: Gemfile.lock removed from version control to allow the Rails matrix (7.1–8.1) to resolve dependencies fresh per job (`bundler-cache: true` set deployment mode which conflicts with per-matrix Gemfile resolution)
|
|
20
|
+
|
|
10
21
|
## [0.1.0] - 2026-04-18
|
|
11
22
|
|
|
12
23
|
### Added
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# weasy_pdf
|
|
1
|
+
# WeasyPDF [](https://badge.fury.io/rb/weasy_pdf) [](https://github.com/denjamio/weasy_pdf/actions/workflows/ci.yml) [](https://opensource.org/licenses/MIT) [](https://www.ruby-lang.org/)
|
|
2
2
|
|
|
3
3
|
Generate PDFs from Rails views using [WeasyPrint](https://weasyprint.org/) — modern CSS, no JavaScript, no Chromium.
|
|
4
4
|
|
|
@@ -35,7 +35,13 @@ No initializer, no `ApplicationController` changes — the Railtie wires everyth
|
|
|
35
35
|
|
|
36
36
|
## Configuration
|
|
37
37
|
|
|
38
|
-
Optional — sensible defaults are used if you skip this:
|
|
38
|
+
Optional — sensible defaults are used if you skip this. The fastest way to scaffold an initializer with all options documented:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
bin/rails generate weasy_pdf:install
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or write it yourself:
|
|
39
45
|
|
|
40
46
|
```ruby
|
|
41
47
|
# config/initializers/weasy_pdf.rb
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rails/generators/base"
|
|
4
|
+
|
|
5
|
+
module WeasyPDF
|
|
6
|
+
module Generators
|
|
7
|
+
class InstallGenerator < Rails::Generators::Base
|
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
|
9
|
+
desc "Creates a WeasyPDF initializer at config/initializers/weasy_pdf.rb"
|
|
10
|
+
|
|
11
|
+
def copy_initializer
|
|
12
|
+
template "weasy_pdf.rb", "config/initializers/weasy_pdf.rb"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
WeasyPDF.configure do |config|
|
|
4
|
+
# Path to the WeasyPrint binary. Auto-detected via PATH if unset.
|
|
5
|
+
# config.exe_path = "/usr/local/bin/weasyprint"
|
|
6
|
+
|
|
7
|
+
# Default render options applied to every PDF unless overridden per-call.
|
|
8
|
+
config.default_options = {
|
|
9
|
+
page_size: "A4",
|
|
10
|
+
orientation: "Portrait",
|
|
11
|
+
margin_top: "15mm",
|
|
12
|
+
margin_bottom: "15mm",
|
|
13
|
+
margin_left: "10mm",
|
|
14
|
+
margin_right: "10mm",
|
|
15
|
+
encoding: "utf-8",
|
|
16
|
+
media_type: "print"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
# base_url prepends to relative URLs in the rendered HTML when no asset can
|
|
20
|
+
# be resolved from disk. Useful in development with the Rails dev server.
|
|
21
|
+
# config.base_url = Rails.env.development? ? "http://localhost:3000" : nil
|
|
22
|
+
|
|
23
|
+
# Maximum seconds to wait for WeasyPrint before raising TimeoutError.
|
|
24
|
+
config.timeout = 60
|
|
25
|
+
end
|
data/lib/weasy_pdf/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: weasy_pdf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Diego Enjamio
|
|
@@ -108,6 +108,8 @@ files:
|
|
|
108
108
|
- CHANGELOG.md
|
|
109
109
|
- LICENSE
|
|
110
110
|
- README.md
|
|
111
|
+
- lib/generators/weasy_pdf/install_generator.rb
|
|
112
|
+
- lib/generators/weasy_pdf/templates/weasy_pdf.rb
|
|
111
113
|
- lib/weasy_pdf.rb
|
|
112
114
|
- lib/weasy_pdf/command_builder.rb
|
|
113
115
|
- lib/weasy_pdf/configuration.rb
|