Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["3.1", "3.2", "3.3"]
ruby-version: ["3.3", "3.4", "4.0"]

steps:
- uses: actions/checkout@v4
Expand All @@ -32,26 +32,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: 4.0
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: bundle exec rubocop

coverage:
name: Coverage
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: paambaati/codeclimate-action@v9.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: bundle exec rake
coverageLocations: |
${{github.workspace}}/spec/coverage/coverage.json:simplecov
70 changes: 40 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PATH
remote: .
specs:
prawn-markup (1.1.0)
base64
nokogiri
prawn
prawn-table
Expand All @@ -10,29 +11,33 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (2.0.1)
afm (0.2.2)
ast (2.4.2)
bigdecimal (3.1.9)
byebug (11.1.3)
diff-lcs (1.6.0)
afm (1.0.0)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (3.3.1)
byebug (13.0.0)
reline (>= 0.6.0)
diff-lcs (1.6.2)
docile (1.4.1)
hashery (2.1.2)
json (2.10.2)
language_server-protocol (3.17.0.4)
io-console (0.8.2)
json (2.19.4)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
matrix (0.4.2)
nokogiri (1.18.9-x86_64-linux-gnu)
logger (1.7.0)
matrix (0.4.3)
nokogiri (1.19.2-x86_64-linux-gnu)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.7.1)
parallel (1.28.0)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
pdf-core (0.10.0)
pdf-inspector (1.3.0)
pdf-reader (>= 1.0, < 3.0.a)
pdf-reader (2.14.1)
pdf-reader (2.15.1)
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
afm (~> 0.2.1)
afm (>= 0.2.1, < 2)
hashery (~> 2.0)
ruby-rc4
ttfunk
Expand All @@ -42,56 +47,61 @@ GEM
ttfunk (~> 1.8)
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
prism (1.9.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.10.0)
rspec (3.13.0)
rake (13.4.2)
regexp_parser (2.12.0)
reline (0.6.3)
io-console (~> 0.5)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rubocop (1.72.2)
rspec-support (3.13.7)
rubocop (1.86.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
bundler
byebug
logger
matrix
pdf-inspector
prawn-markup!
Expand All @@ -101,4 +111,4 @@ DEPENDENCIES
simplecov

BUNDLED WITH
2.2.31
2.7.1
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Prawn::Markup

[![Build Status](https://github.com/puzzle/prawn-markup/actions/workflows/build.yml/badge.svg)](https://github.com/puzzle/prawn-markup/actions/workflows/build.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/52a462f9d65e33352d4e/maintainability)](https://codeclimate.com/github/puzzle/prawn-markup/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/52a462f9d65e33352d4e/test_coverage)](https://codeclimate.com/github/puzzle/prawn-markup/test_coverage)

Adds simple HTML snippets into [Prawn](http://prawnpdf.org)-generated PDFs. All elements are layouted vertically using Prawn's formatting options. A major use case for this gem is to include WYSIWYG-generated HTML parts into server-generated PDF documents.

Expand Down
2 changes: 1 addition & 1 deletion lib/prawn/markup/builders/nestable_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def natural_image_dimensions(hash)

def extract_text_cell_style(hash)
TEXT_STYLE_OPTIONS
.each_with_object({}) { |key, h| h[key] = hash[key] }
.to_h { |key| [key, hash[key]] }
.tap { |options| convert_style_options(options) }
end

Expand Down
1 change: 1 addition & 0 deletions lib/prawn/markup/processor/images.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'base64'
require 'open-uri'

module Prawn
Expand Down
2 changes: 2 additions & 0 deletions prawn-markup.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_dependency 'base64'
spec.add_dependency 'nokogiri'
spec.add_dependency 'prawn'
spec.add_dependency 'prawn-table'

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'byebug'
spec.add_development_dependency 'logger'
spec.add_development_dependency 'matrix'
spec.add_development_dependency 'pdf-inspector'
spec.add_development_dependency 'rake'
Expand Down
Loading