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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ce26a8ece90c530b6b5066c8b472213772024754487d1c499eaa176ea998303
4
- data.tar.gz: f67004ea643989f581f5247016e4f324629fa6a250f02cc2cd2075ee119d74cf
3
+ metadata.gz: 12b1d3cf6d3b8596b9ab9e5873d05dbc29ebff24966de276e0cc5d234247273d
4
+ data.tar.gz: 1df1d355f3a8b52074edaf604370025df78d8e93bb30a7ec88fd4ad1fa870827
5
5
  SHA512:
6
- metadata.gz: da3107e0b8a6d0b35f2217f4c96bf2ec412a8a6616de8b0d1c93fac805e92d6fbab6f902ba14e09f4745d2c5acae9bfa25c9c057f630464e04e9d5fbc2c2f080
7
- data.tar.gz: 274b8f9f21837733e59926205339b19a8196595d07a1708d4f510c68564d0801d202e846b15a8a9b6a96f4adda8a29a6caa783f07b83024772d01f6795b0af90
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 [![Gem Version](https://badge.fury.io/rb/weasy_pdf.svg)](https://badge.fury.io/rb/weasy_pdf) [![Build Status](https://github.com/denjamio/weasy_pdf/actions/workflows/ci.yml/badge.svg)](https://github.com/denjamio/weasy_pdf/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Ruby](https://img.shields.io/badge/ruby-%3E%3D%203.2-red.svg)](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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WeasyPDF
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
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