From b00df78b5eccc4ada7fa93a968344f29abf34148 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 12 Jul 2019 22:28:45 +0200 Subject: [PATCH 01/17] gemspec: Drop EOL'd property rubyforge_project --- prawn-table.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/prawn-table.gemspec b/prawn-table.gemspec index ad721c5..9eab674 100644 --- a/prawn-table.gemspec +++ b/prawn-table.gemspec @@ -16,7 +16,6 @@ Gem::Specification.new do |spec| spec.test_files = Dir[ "spec/*_spec.rb" ] spec.authors = ["Gregory Brown","Brad Ediger","Daniel Nelson","Jonathan Greenberg","James Healy", "Hartwig Brandl"] spec.email = ["gregory.t.brown@gmail.com","brad@bradediger.com","dnelson@bluejade.com","greenberg@entryway.net","jimmy@deefa.com", "mail@hartwigbrandl.at"] - spec.rubyforge_project = "prawn" spec.licenses = %w(PRAWN GPL-2.0 GPL-3.0) spec.add_dependency('prawn', '>= 1.3.0', '< 3.0.0') From 5bc83f56ce71e7ef37c36bf291a1bb809965d420 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Sun, 6 Feb 2022 08:42:47 -0800 Subject: [PATCH 02/17] Migrate to GitHub Actions This PR gets CI running with GitHub Actions. It uses a slightly modified version of the prawnpdf/prawn config file. It also: 1. Includes a fixture file originally imported with the prawn gem. Paths in specs were updated 2. Addresses a couple of keyword argument ambiguities 3. Updates the CI badge in the README 4. Conditionally adds the matrix gem to the gemspec when Ruby version is 3.1.0 or higher, as matrix is no longer bundled with Ruby Thanks to @leoarnold for his original PR and driving the CI change. --- .github/workflows/ci.yml | 49 +++++++++++++++++++++++++ .travis.yml | 20 ---------- README.md | 2 +- prawn-table.gemspec | 3 ++ spec/cell_spec.rb | 4 +- spec/extensions/file_fixture_helper.rb | 15 ++++++++ spec/fixtures/files/prawn.png | Bin 0 -> 13097 bytes spec/spec_helper.rb | 1 + spec/table_spec.rb | 6 ++- 9 files changed, 75 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100644 spec/extensions/file_fixture_helper.rb create mode 100644 spec/fixtures/files/prawn.png diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..22b2306 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + pull_request: + schedule: + - cron: "6 20 * * 6" + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - "2.5.0" + - "2.5" + - "2.6.0" + - "2.6" + - "2.7.0" + - "2.7" + - "3.0.0" + - "3.0" + - "3.1.0" + - "3.1" + - ruby-head + - jruby-9.2 + - jruby-9.3 + steps: + - uses: actions/checkout@v1 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Gems cache + uses: actions/cache@v2 + with: + path: ~/gems + key: gems-${{ matrix.ruby }}-${{ hashFiles('*.gemspec', 'Gemfile') }}-${{ github.sha }} + restore-keys: | + gems-${{ matrix.ruby }}-${{ hashFiles('*.gemspec', 'Gemfile') }}- + gems-${{ matrix.ruby }}- + - name: Install dependencies + run: | + gem install bundler + bundle config path ~/gems + bundle install --jobs 4 --retry 3 + - name: Run tests + run: bundle exec rake spec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cff7229..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: ruby -before_install: - - gem install bundler - - bundle --version -rvm: - - 2.0.0-p0 - - 2.0.0-p648 - - 2.1.0-p0 - - 2.1.8 - - 2.2.0-p0 - - 2.2.4 - - 2.3.0 - - rbx-2 - - jruby-9.0.4.0 -matrix: - include: - - rvm: jruby-1.7.22 - env: JRUBY_OPTS=--2.0 - allow_failures: - - rvm: rbx-2 diff --git a/README.md b/README.md index 732ca7e..7a8612c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Prawn::Table [![Gem Version](https://badge.fury.io/rb/prawn-table.png)](http://badge.fury.io/rb/prawn-table) -[![Build Status](https://secure.travis-ci.org/prawnpdf/prawn-table.png)](http://travis-ci.org/prawnpdf/prawn-table) +![Build Status](https://github.com/prawnpdf/prawn-table/actions/workflows/tests.yml/badge.svg) [![Code Climate](https://codeclimate.com/github/prawnpdf/prawn-table.png)](https://codeclimate.com/github/prawnpdf/prawn-table) ![Maintained: PRs accepted](https://img.shields.io/badge/maintained-PRs_accepted-orange.png) diff --git a/prawn-table.gemspec b/prawn-table.gemspec index 9eab674..37b7a86 100644 --- a/prawn-table.gemspec +++ b/prawn-table.gemspec @@ -19,6 +19,9 @@ Gem::Specification.new do |spec| spec.licenses = %w(PRAWN GPL-2.0 GPL-3.0) spec.add_dependency('prawn', '>= 1.3.0', '< 3.0.0') + + spec.add_dependency('matrix') if RUBY_VERSION >= '3.1.0' + spec.add_development_dependency('pdf-inspector', '~> 1.1.0') spec.add_development_dependency('yard') spec.add_development_dependency('rspec', '~> 3.0') diff --git a/spec/cell_spec.rb b/spec/cell_spec.rb index 4cbecff..90a6226 100644 --- a/spec/cell_spec.rb +++ b/spec/cell_spec.rb @@ -592,7 +592,7 @@ def cell(options={}) describe "with default options" do before(:each) do @cell = Prawn::Table::Cell.make(@pdf, - :image => "#{Prawn::DATADIR}/images/prawn.png") + { :image => file_fixture("prawn.png").to_s }) end it "should create a Cell::Image" do @@ -608,7 +608,7 @@ def cell(options={}) describe "hash syntax" do before(:each) do @table = @pdf.make_table([[{ - :image => "#{Prawn::DATADIR}/images/prawn.png", + :image => file_fixture("prawn.png").to_s, :scale => 2, :fit => [100, 200], :image_width => 123, diff --git a/spec/extensions/file_fixture_helper.rb b/spec/extensions/file_fixture_helper.rb new file mode 100644 index 0000000..6d0c320 --- /dev/null +++ b/spec/extensions/file_fixture_helper.rb @@ -0,0 +1,15 @@ +require 'pathname' + +module FileFixtureHelper + FIXTURES_PATH = Pathname.new(File.expand_path("../fixtures", __dir__)).freeze + FILE_FIXTURES_PATH = FIXTURES_PATH.join("files").freeze + + def file_fixture(relative_path) + pathname = FILE_FIXTURES_PATH.join(relative_path) + + raise ArgumentError, "File '#{pathname}' not found" unless pathname.file? + + pathname + end +end + diff --git a/spec/fixtures/files/prawn.png b/spec/fixtures/files/prawn.png new file mode 100644 index 0000000000000000000000000000000000000000..4b369462e55ab1f97932031f036e4447d79d2edd GIT binary patch literal 13097 zcmV+^GuF(BP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igV* z4IdM9xsGfKWi8&~&Crn$onHhdZ6Uet+B~ zB+byI%~Z&Go;+Mm&$)N+eZG55dkw<7h?=fjI5i%#?-7-`2sywUARR~r(tr>kKpoHw zgb}JyDMxgtC_62>Q&qN&DJtH1`CT7m@!Ux>=O1z!rq+IJQy5QXfH8-FXuF_KSmcR_ z$M?^PcRkfO3Yw83hE^~3G*m{v2z(nz0;+*~JdWoV$#*?nHY8&Jsb4uiTf|wY%11>w z8)ZU=TcRL;SJB@@jPJ2y89>K8XzEtZKhEGhq;M)=1%A=u_`W{eFGW{l>MQc*8PSib z$VY%P08i_pHv@lA(cc7Z^#7!2Q*0D8Lj{;s3*ILxe*(qitvCn`t!8AO16)JW-yiAf(0j8k!M;>niUOd!{+EHXa-`T3-Z<@ECbmXtgbzKBra@!sp`swL7!Jw zi1K-a?AFV>6}}akQv4fPjU5He(djYI0d*eH6O-4JRJ@bi2D%#4P?>iD!VM_zZ@v6) zwQ^J1JsbZ#3YsI~GAr|b4}3!5^J#^}Kj$4xwFP+}5#dJyr?f)qDK+M%w7WMxHwv0Q zQqAY`raN(VqU;OS)XjV+h^51F9+3K#3qCC>-)$9J3VN>_@qcOT+NWxVV@&2)T0kex zC4fPA=-mLA)?KY>g(VLLYwG4I`URi~{6THhvHf)Zj z6_)%gu4XQxe@2*!$Yb>@7yPdA+S4bGf~IFyJr6+Qb`$SXN-uhLPiRfa#}t+U2SF~j zuJ^UNl?y*Ms?&61lKQ<`4>W`di$jbO4Xg4ds!|AC2v`;Qe(2!T?+muj>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5I%xEOHCN$6GJe zi15jgVmOQ#XPe%zAgQ6n+>GjtB!Z%9QT=f+g`c%n9ew9>mTMPe8&_5$OoR9&!Wnn(0|pi2RRvKPbZppC2@DKdS)!E(*QGmLV*s(y+@#np(w z8iXGN*A(v`Y2zKSZvBQ;c_*s!L*V?@OBEo$K)v_$R&eK7p#*2;Gotc2g;QHE#}U@X zt@&PGvmHl4(+$-ZELw!m9)3_k$sB( z(kr^=Sn!k|GY5#ZSDiJ}c;cT!`7DVNUjUm$*?>434p)e0xD{I!bCIGKlZex8Tm53S z`ioFa{cmNMG8Ep?plPH1*Dg*?ibs~K$Vw7f5N-6DD8E(JCxf;1FAnER(Cg3jH$)mv zN9_41mmp+!oPwf{dW52sH6uL~*=`McO`L|9NP|Q@^@p0Zdkf|zCp$@gH8$i#jb9v_sVXy7 zb*2$!D9j@9H|db!L=ZM9@;4Rv!$_#EF$$VKSSF1v&U{qQ0$rqV2GG~)r1hXqYZymg zsREH=g%WY?^TEKFP4e?UN8YLaq<2juUE{T>+Veb<@0axE~5VrnA0}>_U_pg00000NkvXXu0mjf D|IL9c literal 0 HcmV?d00001 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8b2c1c2..155df8e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -26,6 +26,7 @@ RSpec.configure do |config| config.include EncodingHelpers + config.include FileFixtureHelper end def create_pdf(klass=Prawn::Document) diff --git a/spec/table_spec.rb b/spec/table_spec.rb index c293454..357ab19 100644 --- a/spec/table_spec.rb +++ b/spec/table_spec.rb @@ -943,13 +943,15 @@ " block" do stylable = double - expect(stylable).to receive(:style).with(:foo => :bar).once.and_yield + expect(stylable).to receive(:style).with({:foo => :bar}).once.and_yield block = double expect(block).to receive(:kick).once Prawn::Document.new do - table([["x"]]) { style(stylable, :foo => :bar) { block.kick } } + table([["x"]]) do + style(stylable, {:foo => :bar}) { block.kick } + end end end From 9a67f513afe3843c023187583ae25f07e860d10c Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 7 Feb 2022 12:54:34 -0800 Subject: [PATCH 03/17] Temporarily remove 3.1 from CI until the next prawn release --- .github/workflows/ci.yml | 2 -- prawn-table.gemspec | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22b2306..4a2ebf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,6 @@ jobs: - "2.7" - "3.0.0" - "3.0" - - "3.1.0" - - "3.1" - ruby-head - jruby-9.2 - jruby-9.3 diff --git a/prawn-table.gemspec b/prawn-table.gemspec index 37b7a86..dfef4a2 100644 --- a/prawn-table.gemspec +++ b/prawn-table.gemspec @@ -20,8 +20,6 @@ Gem::Specification.new do |spec| spec.add_dependency('prawn', '>= 1.3.0', '< 3.0.0') - spec.add_dependency('matrix') if RUBY_VERSION >= '3.1.0' - spec.add_development_dependency('pdf-inspector', '~> 1.1.0') spec.add_development_dependency('yard') spec.add_development_dependency('rspec', '~> 3.0') From 2b22139d02cdc8d234a7592d3ae8c55f920bbfa3 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 7 Feb 2022 13:04:55 -0800 Subject: [PATCH 04/17] Remove ruby-head, because it also requires matrix --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a2ebf6..8f26b87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ jobs: - "2.7" - "3.0.0" - "3.0" - - ruby-head - jruby-9.2 - jruby-9.3 steps: From 98955a2259673b3f20d3566949c5f24be039eedf Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 7 Feb 2022 12:44:16 -0800 Subject: [PATCH 05/17] Add Time to the class of values that can be used in a cell. Avoid error when value is passed in options --- lib/prawn/table/cell.rb | 21 +++++++++++++-------- spec/cell_spec.rb | 10 +++++++++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/prawn/table/cell.rb b/lib/prawn/table/cell.rb index 83b940f..d3a0f82 100644 --- a/lib/prawn/table/cell.rb +++ b/lib/prawn/table/cell.rb @@ -161,20 +161,16 @@ def max_width # def self.make(pdf, content, options={}) at = options.delete(:at) || [0, pdf.cursor] - content = content.to_s if content.nil? || content.kind_of?(Numeric) || - content.kind_of?(Date) + + return Cell::Image.new(pdf, at, content) if content.is_a?(Hash) && content[:image] if content.is_a?(Hash) - if content[:image] - return Cell::Image.new(pdf, at, content) - end options.update(content) content = options[:content] - else - options[:content] = content end - options[:content] = content = "" if content.nil? + content = content.to_s if stringify_content?(content) + options[:content] = content case content when Prawn::Table::Cell @@ -191,6 +187,15 @@ def self.make(pdf, content, options={}) end end + def self.stringify_content?(content) + return true if content.nil? + return true if content.kind_of?(Numeric) + return true if content.kind_of?(Date) + return true if content.kind_of?(Time) + + false + end + # A small amount added to the bounding box width to cover over floating- # point errors when round-tripping from content_width to width and back. # This does not change cell positioning; it only slightly expands each diff --git a/spec/cell_spec.rb b/spec/cell_spec.rb index 90a6226..7e91313 100644 --- a/spec/cell_spec.rb +++ b/spec/cell_spec.rb @@ -36,13 +36,21 @@ def cell(options={}) end it "should convert nil, Numeric, and Date values to strings" do - [nil, 123, 123.45, Date.today].each do |value| + [nil, 123, 123.45, Date.today, Time.new].each do |value| c = @pdf.cell(:content => value) expect(c).to be_a_kind_of Prawn::Table::Cell::Text expect(c.content).to eq value.to_s end end + it "should convert nil, Numeric, and Date values to strings when value is extracted from options" do + [nil, 123, 123.45, Date.today, Time.new].each do |value| + c = Prawn::Table::Cell.make(@pdf, {}, { :content => value }) + expect(c).to be_a_kind_of Prawn::Table::Cell::Text + expect(c.content).to eq value.to_s + end + end + it "should allow inline styling with a hash argument" do # used for table([[{:text => "...", :font_style => :bold, ...}, ...]]) c = Prawn::Table::Cell.make(@pdf, From 4eb6545fbdfde26520647aa9d7bc93c75d5c63ab Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 7 Feb 2022 13:01:50 -0800 Subject: [PATCH 06/17] Fixes #43 - Migrate error from Prawn to prawn-table This defines an error constant in prawn-table if it is not already defined. This allows us to safely remove it from prawn, and for the gem to work with versions of prawn that define it (or not) --- lib/prawn/table.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/prawn/table.rb b/lib/prawn/table.rb index 264bf7a..59eeaa0 100644 --- a/lib/prawn/table.rb +++ b/lib/prawn/table.rb @@ -26,6 +26,10 @@ module Errors # This error is raised when an empty or nil table is rendered # EmptyTable = Class.new(StandardError) + + # Raised when unrecognized content is provided for a table cell. + # + UnrecognizedTableContent = Class.new(StandardError) unless defined?(::Prawn::Errors::UnrecognizedTableContent) end # Next-generation table drawing for Prawn. From cd4d9f8a4bf08acc288ecd3e808dd37fdeb8ed80 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Tue, 8 Feb 2022 10:23:59 -0800 Subject: [PATCH 07/17] Add images used in manual to repository. Update load paths. Previously these images were being pulled from the prawn gem, but they are no longer included in the gem build. Updated the images to be included in this repo, and updated the paths. With this PR the manual builds with no errors. --- manual/images/prawn.png | Bin 0 -> 13097 bytes manual/images/stef.jpg | Bin 0 -> 4520 bytes manual/table/content_and_subtables.rb | 2 +- manual/table/image_cells.rb | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 manual/images/prawn.png create mode 100644 manual/images/stef.jpg diff --git a/manual/images/prawn.png b/manual/images/prawn.png new file mode 100644 index 0000000000000000000000000000000000000000..4b369462e55ab1f97932031f036e4447d79d2edd GIT binary patch literal 13097 zcmV+^GuF(BP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igV* z4IdM9xsGfKWi8&~&Crn$onHhdZ6Uet+B~ zB+byI%~Z&Go;+Mm&$)N+eZG55dkw<7h?=fjI5i%#?-7-`2sywUARR~r(tr>kKpoHw zgb}JyDMxgtC_62>Q&qN&DJtH1`CT7m@!Ux>=O1z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=`McO`L|9NP|Q@^@p0Zdkf|zCp$@gH8$i#jb9v_sVXy7 zb*2$!D9j@9H|db!L=ZM9@;4Rv!$_#EF$$VKSSF1v&U{qQ0$rqV2GG~)r1hXqYZymg zsREH=g%WY?^TEKFP4e?UN8YLaq<2juUE{T>+Veb<@0axE~5VrnA0}>_U_pg00000NkvXXu0mjf D|IL9c literal 0 HcmV?d00001 diff --git a/manual/images/stef.jpg b/manual/images/stef.jpg new file mode 100644 index 0000000000000000000000000000000000000000..039dd899e086690622716ef091b0078e94655b7b GIT binary patch literal 4520 zcmbW4XH*m0yT&IZK#*pnmjeih6h*2aEi@@2(v*%7X-1k_Fch;14+{414H7d%d!d6}eZ)+C zUA@qLUVxHwXN0}K!-lmP~%*Gr#3NCf>l07EdIIH{<|#AW5mEFQqE^dPeY zE}`Gp!DBs2mQ=nO7{hXmmycgS@RZbPX&G4+)$?lV7c>kEFB%z}m|n8Edd=3(-oeq$ z-NV!C7W#Hja7gIgu<(1aaq$U>Ny#Z$*^hH_^PW7-FD)ytsI024dH(8kQ}dg*E$>?K zon75My?y^B$TbmJU0VJkMT;X5KmE# z(EgD9@4#aIUu6G+{WsSPzy^iT7Y~X6kig*&(O~P*`4m99G)=L;nBmD#qTZuibxxH&0cu>5KV^81 z$uv|_`8+%o;<;uUt^LlPw+GO9y!qYx$H1=rVP(jiK~Mg6N5c%WE#VCE787N+>lmRAHBu zQT%ewgR2*XU-PQ-L!YfyM#wz?3n*?x8h}3+mp88pCX*u6Iz>d9tugygBfS&X#1l^D z%N-1|2CEDfR}=+plH*8TbwhzqyZan=&s-H3`e5phWyh-IRPQ0`>Q4P zz$GT{`WKOU-(#_t$zGcTvIVhy%k>4uaug$1H61qVLRcgOf5VNOxLD@s=-A6J>!6=< zf?KgSPt0RaG%w}X+)WcAVcsm!L_AGONm(?94~Fe?Urm8M1xNR74!9^fne^f{$=EFc z@(Lc^cC9Q-B*G6r&za-5z2jYrX0JtzJEI9^aBCJ#BV~O0I5r+Bf)h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;`+MC*%k`Sy16I6hAqij<<5Q~uha}zRX^}wa#tD#DQ_hmIF;?q)&T1*C(>WftkoR9X z-jP~cH7D}BKZ8!YHHS}CMMZnb3nU9X=Vk_z^N+I3U=oaNhWCT{^mr2WG! zA<1L9J~8wK8`e2-Sh|ftm)veeB~pbpd@0^~nIsA-y7{av`#HcEb5hUqK^6(^!x?#d}9!KcBwM1jEYzg{1y=1wJOfq z_k)`0HwV|MM#_g9e^+)c%~f;oyBF^1Z3EwYKO92TT8SP?^PH^b)3r{#%B;8rJ5kK%gtUK^0r%m+zP+8zSIMz0LO!&LbY&c_| zb3nq!Uacv!MH=w19if7niKTKk^wI!!G?fv2;7_c?@r^onsbG)8umgOd^0T^Wh6CX~ z5ToRTPtNhX5njDi;ZFxApWog~Om0$d+K`ixYKhu1(N!$X>V!}}A)-H+G-Q`A$JX|( zRYqJh>EvTnpKSbHvaf585qv-98Fv(GJ$b%}e^hmw>-Ke-@$GV@;ZwOp zseRRoChPLdr-+ga+oQ)E%Dy-|Idq67 zwcR>&H_W;Ep*h(<`_77?!1njZQBbWzho8*cStp0r;TTofW)BN8dvN0=p$X)bcGZgs zcnix49PG*(bV!!W-`B9eHIi$cDDz!4z&cSyLjEQS9)`L^_Q%tIiZu0;7e|BHWf#l{ z*S^m8!w_ez7(m9PYfx?S{U0u}rR9%4%CB7ToPi*nZK6B&2YcVCeAs9;GZ@Nbjo2;C z#O+70l;*hf=k@fjm8QJHm*ha@HN0BZFEFQH!J;mQ)Kr&1NDI73uZ38w@QbE39k~N7 z@^-47#kpM;{~O}oH@@<*$nx9~5{~|?&RpG3mg5AaXuu|_5{z39ZHESj``zVbxnH|5 zr^_;O(3l(gD4G+fXJ*2!>{$nGSQ8oRQn{ image}], From 0837d326096347572ab1244978731089e77ea160 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Tue, 8 Feb 2022 10:40:47 -0800 Subject: [PATCH 08/17] Fix a typo (workflow name) in the CI badge With the merging of various sources for CI contributions, the badge name doesn't match the workflow name so the badge doesn't show. This corrects the name of the badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a8612c..24c187b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Prawn::Table [![Gem Version](https://badge.fury.io/rb/prawn-table.png)](http://badge.fury.io/rb/prawn-table) -![Build Status](https://github.com/prawnpdf/prawn-table/actions/workflows/tests.yml/badge.svg) +![Build Status](https://github.com/prawnpdf/prawn-table/actions/workflows/ci.yml/badge.svg) [![Code Climate](https://codeclimate.com/github/prawnpdf/prawn-table.png)](https://codeclimate.com/github/prawnpdf/prawn-table) ![Maintained: PRs accepted](https://img.shields.io/badge/maintained-PRs_accepted-orange.png) From 7a8e658df8246edadb1e8152e5f6fdca8c718291 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Tue, 8 Feb 2022 11:34:46 -0800 Subject: [PATCH 09/17] Update repo to use prawn-dev Sets minimum Ruby version to 2.6. Adds a Rubocop todo that can be burned down. Adds a code style job to CI --- .github/workflows/ci.yml | 26 +- .rubocop.yml | 5 + .rubocop_todo.yml | 1003 ++++++++++++++++++++++++++++++++++++++ Rakefile | 11 +- prawn-table.gemspec | 5 +- spec/cell_spec.rb | 6 +- spec/table_spec.rb | 10 +- 7 files changed, 1047 insertions(+), 19 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f26b87..15dce72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,21 +7,41 @@ on: - cron: "6 20 * * 6" jobs: + code-style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1.0 + - name: Gems cache + uses: actions/cache@v2 + with: + path: ~/gems + key: gems-3.1.0-${{ hashFiles('*.gemspec', 'Gemfile') }}-${{ github.sha }} + restore-keys: | + gems-3.1.0-${{ hashFiles('*.gemspec', 'Gemfile') }}- + gems-3.1.0- + - name: Install dependencies + run: | + gem install bundler + bundle config path ~/gems + bundle install --jobs 4 --retry 3 + - name: Check code style + run: bundle exec rake rubocop test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby: - - "2.5.0" - - "2.5" - "2.6.0" - "2.6" - "2.7.0" - "2.7" - "3.0.0" - "3.0" - - jruby-9.2 - jruby-9.3 steps: - uses: actions/checkout@v1 diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..94cdf4c --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,5 @@ +inherit_from: .rubocop_todo.yml + +inherit_gem: + prawn-dev: rubocop.yml + diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..09e219e --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,1003 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2022-02-08 19:46:35 UTC using RuboCop version 1.25.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. +# Include: **/*.gemspec +Gemspec/OrderedDependencies: + Exclude: + - 'prawn-table.gemspec' + +# Offense count: 53 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_argument, with_fixed_indentation +Layout/ArgumentAlignment: + Enabled: false + +# Offense count: 11 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_element, with_fixed_indentation +Layout/ArrayAlignment: + Exclude: + - 'lib/prawn/table/cell/text.rb' + - 'spec/table_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleAlignWith. +# SupportedStylesAlignWith: either, start_of_block, start_of_line +Layout/BlockAlignment: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Layout/BlockEndNewline: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cells.rb' + - 'spec/table_spec.rb' + +# Offense count: 20 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth. +# SupportedStyles: case, end +Layout/CaseIndentation: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: leading, trailing +Layout/DotPosition: + Exclude: + - 'lib/prawn/table/cell/text.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 20 +# Cop supports --auto-correct. +Layout/EmptyLineAfterMagicComment: + Enabled: false + +# Offense count: 11 +# Cop supports --auto-correct. +Layout/EmptyLines: + Exclude: + - 'Rakefile' + - 'lib/prawn/table.rb' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 18 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'manual/contents.rb' + - 'manual/table/cell_borders_and_bg.rb' + - 'manual/table/table.rb' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 20 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only +Layout/EmptyLinesAroundClassBody: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cell/image.rb' + - 'lib/prawn/table/cell/in_table.rb' + - 'lib/prawn/table/cell/span_dummy.rb' + - 'lib/prawn/table/cell/subtable.rb' + - 'lib/prawn/table/cell/text.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines +Layout/EmptyLinesAroundModuleBody: + Exclude: + - 'lib/prawn/table/cell/in_table.rb' + - 'spec/cell_spec.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: keyword, variable, start_of_line +Layout/EndAlignment: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 46 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + - 'manual/table/basic_block.rb' + - 'manual/table/before_rendering_page.rb' + - 'manual/table/cell_border_lines.rb' + - 'manual/table/image_cells.rb' + - 'prawn-table.gemspec' + - 'spec/table_spec.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets +Layout/FirstArrayElementIndentation: + Exclude: + - 'spec/table/span_dummy_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 52 +# Cop supports --auto-correct. +Layout/FirstArrayElementLineBreak: + Enabled: false + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_braces +Layout/FirstHashElementIndentation: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Layout/FirstHashElementLineBreak: + Exclude: + - 'manual/table/cell_borders_and_bg.rb' + - 'manual/table/cell_text.rb' + - 'manual/table/image_cells.rb' + - 'spec/table_spec.rb' + +# Offense count: 81 +# Cop supports --auto-correct. +Layout/FirstMethodArgumentLineBreak: + Enabled: false + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'lib/prawn/table/cell.rb' + - 'manual/table/image_cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: Width, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'manual/table/cell_borders_and_bg.rb' + - 'spec/table_spec.rb' + +# Offense count: 49 +# Cop supports --auto-correct. +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. +Layout/LeadingCommentSpace: + Exclude: + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineArrayBraceLayout: + Exclude: + - 'manual/table/cell_border_lines.rb' + - 'manual/table/cell_borders_and_bg.rb' + - 'manual/table/cell_dimensions.rb' + - 'manual/table/cell_text.rb' + - 'manual/table/filtering.rb' + - 'spec/table_spec.rb' + +# Offense count: 29 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedTypes: block, case, class, if, kwbegin, module +# SupportedStyles: same_line, new_line +Layout/MultilineAssignmentLayout: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cells.rb' + - 'manual/table/filtering.rb' + - 'spec/table_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Layout/MultilineHashKeyLineBreaks: + Exclude: + - 'manual/table/cell_text.rb' + - 'manual/table/image_cells.rb' + - 'spec/table_spec.rb' + +# Offense count: 21 +# Cop supports --auto-correct. +Layout/MultilineMethodArgumentLineBreaks: + Exclude: + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cell/text.rb' + - 'manual/contents.rb' + - 'manual/table/cell_border_lines.rb' + - 'manual/table/cell_text.rb' + - 'manual/table/image_cells.rb' + - 'spec/cell_spec.rb' + - 'spec/table/span_dummy_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineMethodCallBraceLayout: + Exclude: + - 'lib/prawn/table/cell/image.rb' + - 'manual/table/table.rb' + - 'spec/table_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Layout/MultilineMethodCallIndentation: + Exclude: + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 25 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/MultilineOperationIndentation: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'prawn-table.gemspec' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 64 +# Cop supports --auto-correct. +Layout/SpaceAfterComma: + Exclude: + - 'lib/prawn/table/cells.rb' + - 'prawn-table.gemspec' + - 'spec/table/span_dummy_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 18 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +Layout/SpaceAroundEqualsInParameterDefault: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cell/image.rb' + - 'lib/prawn/table/cell/subtable.rb' + - 'lib/prawn/table/cell/text.rb' + - 'lib/prawn/table/cells.rb' + - 'spec/cell_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 81 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. +# SupportedStylesForExponentOperator: space, no_space +Layout/SpaceAroundOperators: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cell/text.rb' + - 'lib/prawn/table/column_width_calculator.rb' + - 'manual/table/cell_border_lines.rb' + - 'prawn-table.gemspec' + - 'spec/table_spec.rb' + +# Offense count: 25 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceBeforeBlockBraces: + Exclude: + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +Layout/SpaceBeforeComma: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 59 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideArrayLiteralBrackets: + Exclude: + - 'manual/table/basic_block.rb' + - 'manual/table/cell_border_lines.rb' + - 'manual/table/cell_borders_and_bg.rb' + - 'manual/table/cell_dimensions.rb' + - 'manual/table/cell_text.rb' + - 'manual/table/column_widths.rb' + - 'manual/table/content_and_subtables.rb' + - 'manual/table/creation.rb' + - 'manual/table/filtering.rb' + - 'spec/table_spec.rb' + +# Offense count: 33 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideBlockBraces: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/cell_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/table_spec.rb' + +# Offense count: 170 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideHashLiteralBraces: + Exclude: + - 'lib/prawn/table/cell.rb' + - 'manual/table/cell_borders_and_bg.rb' + - 'manual/table/cell_dimensions.rb' + - 'manual/table/column_widths.rb' + - 'manual/table/content_and_subtables.rb' + - 'manual/table/image_cells.rb' + - 'manual/table/span.rb' + - 'spec/cell_spec.rb' + - 'spec/table/span_dummy_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 20 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, compact, no_space +Layout/SpaceInsideParens: + Exclude: + - 'Rakefile' + - 'manual/table/table.rb' + - 'spec/table_spec.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Layout/SpaceInsidePercentLiteralDelimiters: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/SpaceInsideRangeLiteral: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideReferenceBrackets: + Exclude: + - 'prawn-table.gemspec' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingEmptyLines: + Exclude: + - 'spec/extensions/file_fixture_helper.rb' + - 'spec/spec_helper.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'lib/prawn/table.rb' + +# Offense count: 1 +# Configuration parameters: AllowSafeAssignment. +Lint/AssignmentInCondition: + Exclude: + - 'lib/prawn/table/cell/text.rb' + +# Offense count: 1 +Lint/LiteralAsCondition: + Exclude: + - 'lib/prawn/table.rb' + +# Offense count: 1 +# Cop supports --auto-correct-all. +Lint/NonDeterministicRequireOrder: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Lint/ParenthesesAsGroupedExpression: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 1 +Lint/UnreachableCode: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/cell_spec.rb' + +# Offense count: 8 +Lint/UselessAssignment: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 5 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +# IgnoredMethods: refine +Metrics/BlockLength: + Max: 40 + +# Offense count: 2 +Naming/ConstantName: + Exclude: + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cell/text.rb' + +# Offense count: 2 +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + +# Offense count: 13 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cell/image.rb' + - 'lib/prawn/table/cell/span_dummy.rb' + +# Offense count: 1 +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. +# NamePrefix: is_, has_, have_ +# ForbiddenPrefixes: is_, has_, have_ +# AllowedMethods: is_a? +# MethodDefinitionMacros: define_method, define_singleton_method +Naming/PredicateName: + Exclude: + - 'spec/**/*' + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 4 +# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers. +# SupportedStyles: snake_case, normalcase, non_integer +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 +Naming/VariableNumber: + Exclude: + - 'manual/table/content_and_subtables.rb' + - 'spec/table_spec.rb' + +# Offense count: 1 +# Configuration parameters: MinSize. +Performance/CollectionLiteralInLoop: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: SafeMultiline. +Performance/EndWith: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Performance/RedundantBlockCall: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Performance/RegexpMatch: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Performance/StringInclude: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 11 +# Cop supports --auto-correct. +# Configuration parameters: OnlySumOrWithInitialValue. +Performance/Sum: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/table_spec.rb' + +# Offense count: 2 +RSpec/AnyInstance: + Exclude: + - 'spec/cell_spec.rb' + +# Offense count: 3 +# Configuration parameters: Prefixes. +# Prefixes: when, with, without +RSpec/ContextWording: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 2 +# Configuration parameters: IgnoredMetadata. +RSpec/DescribeClass: + Exclude: + - '**/spec/features/**/*' + - '**/spec/requests/**/*' + - '**/spec/routing/**/*' + - '**/spec/system/**/*' + - '**/spec/views/**/*' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 131 +# Cop supports --auto-correct. +# Configuration parameters: CustomTransform, IgnoredWords. +RSpec/ExampleWording: + Exclude: + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 14 +# Cop supports --auto-correct. +# Configuration parameters: . +# SupportedStyles: implicit, each, example +RSpec/HookArgument: + EnforcedStyle: each + +# Offense count: 340 +# Configuration parameters: AssignmentOnly. +RSpec/InstanceVariable: + Exclude: + - 'spec/cell_spec.rb' + - 'spec/table/span_dummy_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 71 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: allow, expect +RSpec/MessageExpectation: + Exclude: + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 73 +# Configuration parameters: . +# SupportedStyles: have_received, receive +RSpec/MessageSpies: + EnforcedStyle: receive + +# Offense count: 2 +RSpec/MultipleDescribes: + Exclude: + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: not_to, to_not +RSpec/NotToNot: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: prefer_alias, prefer_alias_method +Style/Alias: + Exclude: + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, conditionals +Style/AndOr: + Exclude: + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 25 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. +# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces +# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object +# FunctionalMethods: let, let!, subject, watch +# IgnoredMethods: lambda, proc, it +Style/BlockDelimiters: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: AllowOnConstant. +Style/CaseEquality: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: is_a?, kind_of? +Style/ClassCheck: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +# IgnoredMethods: ==, equal?, eql? +Style/ClassEqualityComparison: + Exclude: + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 15 +# Cop supports --auto-correct-all. +# Configuration parameters: PreferredMethods, MethodsAcceptingSymbol. +# MethodsAcceptingSymbol: inject, reduce +Style/CollectionMethods: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/table_spec.rb' + +# Offense count: 2 +Style/CombinableLoops: + Exclude: + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'lib/prawn/table.rb' + - 'spec/table_spec.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +Style/Dir: + Exclude: + - 'prawn-table.gemspec' + - 'spec/cell_spec.rb' + - 'spec/table/span_dummy_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/EachWithObject: + Exclude: + - 'lib/prawn/table.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +Style/EmptyCaseCondition: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/EmptyLiteral: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: compact, expanded +Style/EmptyMethod: + Exclude: + - 'lib/prawn/table/cell/span_dummy.rb' + +# Offense count: 34 +# Cop supports --auto-correct. +Style/Encoding: + Enabled: false + +# Offense count: 38 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 468 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +# SupportedShorthandSyntax: always, never, either +Style/HashSyntax: + Enabled: false + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowIfModifier. +Style/IfInsideElse: + Exclude: + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 1 +Style/ImplicitRuntimeError: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 28 +# Cop supports --auto-correct. +Style/LineEndConcatenation: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 1 +Style/MissingRespondToMissing: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/MultilineTernaryOperator: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'lib/prawn/table/cell/text.rb' + +# Offense count: 8 +# Cop supports --auto-correct-all. +# Configuration parameters: EnforcedStyle, IgnoredMethods. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/ParallelAssignment: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cells.rb' + - 'spec/table_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'prawn-table.gemspec' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/RedundantInterpolation: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/column_width_calculator.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantSelf: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: return, return_nil +Style/ReturnNil: + Exclude: + - 'lib/prawn/table/cells.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods. +# AllowedMethods: present?, blank?, presence, try, try! +Style/SafeNavigation: + Exclude: + - 'lib/prawn/table/cell.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: AllowAsExpressionSeparator. +Style/Semicolon: + Exclude: + - 'lib/prawn/table.rb' + - 'spec/table_spec.rb' + +# Offense count: 27 +Style/Send: + Exclude: + - 'lib/prawn/table.rb' + - 'lib/prawn/table/cell.rb' + - 'lib/prawn/table/cells.rb' + - 'lib/prawn/table/column_width_calculator.rb' + - 'spec/table_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct-all. +Style/SlicingWithRange: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct-all. +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'lib/prawn/table.rb' + - 'spec/spec_helper.rb' + +# Offense count: 923 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Enabled: false + +# Offense count: 8 +# Cop supports --auto-correct. +# Configuration parameters: . +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: percent + MinSize: 13 + +# Offense count: 20 +# Cop supports --auto-correct-all. +# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods. +# IgnoredMethods: respond_to, define_method +Style/SymbolProc: + Exclude: + - 'spec/cell_spec.rb' + - 'spec/table_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, AllowSafeAssignment. +# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex +Style/TernaryParentheses: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArrayLiteral: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'spec/table_spec.rb' + +# Offense count: 54 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, MinSize, WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + Exclude: + - 'Rakefile' + - 'manual/table/before_rendering_page.rb' + - 'manual/table/cell_text.rb' + - 'manual/table/creation.rb' + - 'manual/table/row_colors.rb' + - 'manual/table/span.rb' + - 'spec/table_spec.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Layout/LineLength: + Max: 198 diff --git a/Rakefile b/Rakefile index a7d2008..8d66fd0 100644 --- a/Rakefile +++ b/Rakefile @@ -1,14 +1,11 @@ -#encoding: utf-8 +# frozen_string_literal: true -require "bundler" -Bundler.setup +GEMSPEC = File.expand_path('prawn-table.gemspec', __dir__) +require 'prawn/dev/tasks' -require 'rake' -require 'rspec/core/rake_task' require 'yard' -require 'rubygems/package_task' -task :default => [:spec] +task default: %i[spec rubocop] desc "Run all rspec files" RSpec::Core::RakeTask.new("spec") do |c| diff --git a/prawn-table.gemspec b/prawn-table.gemspec index dfef4a2..31b2057 100644 --- a/prawn-table.gemspec +++ b/prawn-table.gemspec @@ -10,8 +10,8 @@ Gem::Specification.new do |spec| ["prawn-table.gemspec", "Gemfile", "COPYING", "LICENSE", "GPLv2", "GPLv3"] spec.require_path = "lib" - spec.required_ruby_version = '>= 1.9.3' - spec.required_rubygems_version = ">= 1.3.6" + spec.required_ruby_version = '>= 2.6' + spec.required_rubygems_version = ">= 2.0.0" spec.test_files = Dir[ "spec/*_spec.rb" ] spec.authors = ["Gregory Brown","Brad Ediger","Daniel Nelson","Jonathan Greenberg","James Healy", "Hartwig Brandl"] @@ -25,6 +25,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency('rspec', '~> 3.0') spec.add_development_dependency('rake') spec.add_development_dependency('simplecov') + spec.add_development_dependency('prawn-dev', '~> 0.3.0') spec.add_development_dependency('prawn-manual_builder', ">= 0.2.0") spec.add_development_dependency('pdf-reader', '~>1.2') diff --git a/spec/cell_spec.rb b/spec/cell_spec.rb index 7e91313..9a5a0fa 100644 --- a/spec/cell_spec.rb +++ b/spec/cell_spec.rb @@ -407,7 +407,7 @@ def cell(options={}) expect(@pdf).to receive(:stroke_color=).with("ff00ff") c = @pdf.cell(:content => "text", - :border_color => %w[ff0000 00ff00 0000ff ff00ff]) + :border_color => %w[ff0000 00ff00 0000ff ff00ff]) expect(c.border_colors).to eq %w[ff0000 00ff00 0000ff ff00ff] end @@ -434,7 +434,7 @@ def cell(options={}) expect(@pdf).to receive(:line_width=).with(5) c = @pdf.cell(:content => "text", - :border_width => [2, 3, 4, 5]) + :border_width => [2, 3, 4, 5]) expect(c.border_widths).to eq [2, 3, 4, 5] end @@ -455,7 +455,7 @@ def cell(options={}) it "should set border lines with :border_lines" do c = @pdf.cell(:content => "text", - :border_lines => [:solid, :dotted, :dashed, :solid]) + :border_lines => [:solid, :dotted, :dashed, :solid]) expect(c.border_lines).to eq [:solid, :dotted, :dashed, :solid] end end diff --git a/spec/table_spec.rb b/spec/table_spec.rb index 357ab19..553f13c 100644 --- a/spec/table_spec.rb +++ b/spec/table_spec.rb @@ -982,8 +982,9 @@ it "should ignore headers" do data = [["header"], ["foo"], ["bar"], ["baz"]] pdf = Prawn::Document.new - t = pdf.table(data, :header => true, - :row_colors => ['cccccc', 'ffffff']) do + t = pdf.table(data, + { :header => true, + :row_colors => ['cccccc', 'ffffff']}) do row(0).background_color = '333333' end @@ -993,8 +994,9 @@ it "stripes rows consistently from page to page, skipping header rows" do data = [["header"]] + [["foo"]] * 70 pdf = Prawn::Document.new - t = pdf.make_table(data, :header => true, - :row_colors => ['cccccc', 'ffffff']) do + t = pdf.make_table(data, + { :header => true, + :row_colors => ['cccccc', 'ffffff']}) do cells.padding = 0 cells.size = 9 row(0).size = 11 From 9600c9cb0517b2e7a8f8b4b35a514e257d23ea44 Mon Sep 17 00:00:00 2001 From: Russell Sanders Date: Fri, 16 Oct 2015 13:13:19 -0700 Subject: [PATCH 10/17] Keep more specific cell styling instead of it being overwritten by the table cell_style https://github.com/prawnpdf/prawn-table/issues/56 --- lib/prawn/table.rb | 24 ++++++++++++++---------- lib/prawn/table/cell.rb | 2 +- spec/table_spec.rb | 10 ++++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/lib/prawn/table.rb b/lib/prawn/table.rb index 59eeaa0..56f0a66 100644 --- a/lib/prawn/table.rb +++ b/lib/prawn/table.rb @@ -103,7 +103,7 @@ module Errors # end # class Table - module Interface + module Interface # @group Experimental API # Set up and draw a table on this document. A block can be given, which will @@ -140,7 +140,7 @@ def make_table(data, options={}, &block) # def initialize(data, document, options={}, &block) @pdf = document - @cells = make_cells(data) + @cells = make_cells(data, options.delete(:cell_style) || {}) @header = false options.each { |k, v| send("#{k}=", v) } @@ -295,7 +295,7 @@ def draw cells_this_page = [] @cells.each do |cell| - if start_new_page?(cell, offset, ref_bounds) + if start_new_page?(cell, offset, ref_bounds) # draw cells on the current page and then start a new one # this will also add a header to the new page if a header is set # reset array of cells for the new page @@ -385,7 +385,7 @@ def row_heights end protected - + # sets the background color (if necessary) for the given cell def set_background_color(cell, started_new_page_at_row) if defined?(@row_colors) && @row_colors && (!@header || cell.row > 0) @@ -433,9 +433,9 @@ def ink_and_draw_cells(cells_this_page, draw_cells = true) def ink_and_draw_cells_and_start_new_page(cells_this_page, cell) # don't draw only a header draw_cells = (@header_row.nil? || cells_this_page.size > @header_row.size) - + ink_and_draw_cells(cells_this_page, draw_cells) - + # start a new page or column @pdf.bounds.move_past_bottom @@ -513,7 +513,7 @@ def header_rows # Prawn::Table::Cell, and sets up their in-table properties so that they # know their own position in the table. # - def make_cells(data) + def make_cells(data, cell_style = {}) assert_proper_table_data(data) cells = Cells.new @@ -527,7 +527,11 @@ def make_cells(data) column_number += 1 until cells[row_number, column_number].nil? # Build the cell and store it in the Cells collection. - cell = Cell.make(@pdf, cell_data) + cell = if cell_data.is_a?(Hash) + Cell.make(@pdf, cell_style.merge(cell_data)) + else + Cell.make(@pdf, cell_data, cell_style) + end cells[row_number, column_number] = cell # Add dummy cells for the rest of the cells in the span group. This @@ -580,7 +584,7 @@ def add_header(row_number, cells_this_page) number_of_header_rows.times do |h| additional_header_height = add_one_header_row(cells_this_page, x_offset, y_coord-header_height, row_number-1, h) header_height += additional_header_height - end + end end header_height end @@ -597,7 +601,7 @@ def add_one_header_row(page_of_cells, x_offset, y, row, row_of_header=nil) rows_to_operate_on = @header_row.rows(row_of_header) if row_of_header rows_to_operate_on.each do |cell| cell.row = row - cell.dummy_cells.each {|c| + cell.dummy_cells.each {|c| if cell.rowspan > 1 # be sure to account for cells that span multiple rows # in this case you need multiple row numbers diff --git a/lib/prawn/table/cell.rb b/lib/prawn/table/cell.rb index d3a0f82..3dbbc84 100644 --- a/lib/prawn/table/cell.rb +++ b/lib/prawn/table/cell.rb @@ -224,7 +224,7 @@ def initialize(pdf, point, options={}) @rowspan = 1 @dummy_cells = [] - options.each { |k, v| send("#{k}=", v) } + style(options) @initializer_run = true end diff --git a/spec/table_spec.rb b/spec/table_spec.rb index 553f13c..652840b 100644 --- a/spec/table_spec.rb +++ b/spec/table_spec.rb @@ -1613,4 +1613,14 @@ pdf.render expect(pdf.page_count).to eq 1 end + + it 'illustrates issue #56 cell style should not be overwritten by table style', issue: 56 do + t = @pdf.table([['col1', 'col2'], + ['val1', { content: 'val2', align: :left }]], + cell_style: { align: :center }) + t.cells[0, 0].align.should == :center + t.cells[0, 1].align.should == :center + t.cells[1, 0].align.should == :center + t.cells[1, 1].align.should == :left + end end From 1050cbd5dfcc05d6f8c10f5ada406ebb6333d7bb Mon Sep 17 00:00:00 2001 From: Russell Sanders Date: Mon, 30 Nov 2015 16:39:42 -0800 Subject: [PATCH 11/17] Add a CHANGELOG entry and documentation for the manual --- CHANGELOG.md | 1 + manual/table/style.rb | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d59195..22bcb13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Master +* Bugfix: Use a cell's custom style over table styles. (PR [#59](https://github.com/prawnpdf/prawn-table/pull/59), issue [#65](https://github.com/prawnpdf/prawn-table/issues/56)) * Bugfix: Use the cell's specified font to calculate the cell width. (Jesse Doyle, PR [#60](https://github.com/prawnpdf/prawn-table/pull/60), issue [#42](https://github.com/prawnpdf/prawn-table/issues/42)) ## 0.2.3 diff --git a/manual/table/style.rb b/manual/table/style.rb index 22c8f56..b618605 100644 --- a/manual/table/style.rb +++ b/manual/table/style.rb @@ -7,6 +7,11 @@ # also accepts a block that will be called for each cell and can be used for # some complex styling. # +# Individual cell styles can also be applied when defining the data for the +# table using a hash syntax for the cell. This style will take precedence over +# any table level cell styles. See the "cell_text" section for a list of +# options. + require File.expand_path(File.join(File.dirname(__FILE__), %w[.. example_helper])) @@ -19,4 +24,10 @@ c.background_color = ((c.row + c.column) % 2).zero? ? '000000' : 'ffffff' end end + move_down 20 + + table( + [['A', 'B'],['C', { content: 'D', text_color: 'ff0000' }]], + cell_style: { text_color: '0000ff' } + ) end From f0b0d7d3e112699fbd37e98e021ca5ac99b7e9dd Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Sun, 13 Feb 2022 22:34:50 -0800 Subject: [PATCH 12/17] Fix lints, update spec syntax --- lib/prawn/table.rb | 8 ++++---- manual/table/style.rb | 2 +- spec/table_spec.rb | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/prawn/table.rb b/lib/prawn/table.rb index 56f0a66..5e349a7 100644 --- a/lib/prawn/table.rb +++ b/lib/prawn/table.rb @@ -528,10 +528,10 @@ def make_cells(data, cell_style = {}) # Build the cell and store it in the Cells collection. cell = if cell_data.is_a?(Hash) - Cell.make(@pdf, cell_style.merge(cell_data)) - else - Cell.make(@pdf, cell_data, cell_style) - end + Cell.make(@pdf, cell_style.merge(cell_data)) + else + Cell.make(@pdf, cell_data, cell_style) + end cells[row_number, column_number] = cell # Add dummy cells for the rest of the cells in the span group. This diff --git a/manual/table/style.rb b/manual/table/style.rb index b618605..9b523eb 100644 --- a/manual/table/style.rb +++ b/manual/table/style.rb @@ -27,7 +27,7 @@ move_down 20 table( - [['A', 'B'],['C', { content: 'D', text_color: 'ff0000' }]], + [%w[A B], ['C', { content: 'D', text_color: 'ff0000' }]], cell_style: { text_color: '0000ff' } ) end diff --git a/spec/table_spec.rb b/spec/table_spec.rb index 652840b..cd5beac 100644 --- a/spec/table_spec.rb +++ b/spec/table_spec.rb @@ -1618,9 +1618,9 @@ t = @pdf.table([['col1', 'col2'], ['val1', { content: 'val2', align: :left }]], cell_style: { align: :center }) - t.cells[0, 0].align.should == :center - t.cells[0, 1].align.should == :center - t.cells[1, 0].align.should == :center - t.cells[1, 1].align.should == :left + expect(t.cells[0, 0].align).to eq :center + expect(t.cells[0, 1].align).to eq :center + expect(t.cells[1, 0].align).to eq :center + expect(t.cells[1, 1].align).to eq :left end end From 18b511a06947ae3ea5c37264841c9f3c971ced54 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Tue, 15 Feb 2022 04:49:57 -0800 Subject: [PATCH 13/17] Fix changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22bcb13..33f2472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## Master -* Bugfix: Use a cell's custom style over table styles. (PR [#59](https://github.com/prawnpdf/prawn-table/pull/59), issue [#65](https://github.com/prawnpdf/prawn-table/issues/56)) +* Bugfix: Use a cell's custom style over table styles. (PR [#143](https://github.com/prawnpdf/prawn-table/pull/143), issue [#56](https://github.com/prawnpdf/prawn-table/issues/56)) * Bugfix: Use the cell's specified font to calculate the cell width. (Jesse Doyle, PR [#60](https://github.com/prawnpdf/prawn-table/pull/60), issue [#42](https://github.com/prawnpdf/prawn-table/issues/42)) ## 0.2.3 From 066dc265b653d3b84f3881f69e5baf76f7954e42 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Tue, 15 Feb 2022 04:53:57 -0800 Subject: [PATCH 14/17] Eliminate mutation of argument --- lib/prawn/table.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/prawn/table.rb b/lib/prawn/table.rb index 5e349a7..b000d3a 100644 --- a/lib/prawn/table.rb +++ b/lib/prawn/table.rb @@ -139,10 +139,13 @@ def make_table(data, options={}, &block) # above for details on available options. # def initialize(data, document, options={}, &block) + table_opts = options.dup @pdf = document - @cells = make_cells(data, options.delete(:cell_style) || {}) + @cells = make_cells(data, table_opts.delete(:cell_style) || {}) @header = false - options.each { |k, v| send("#{k}=", v) } + table_opts.each do |k, v| + send("#{k}=", v) if respond_to?("#{k}=") + end if block block.arity < 1 ? instance_eval(&block) : block[self] From b5bfd8465ebbc171599572dac596b92317698f6a Mon Sep 17 00:00:00 2001 From: Bruno Enten Date: Wed, 14 Dec 2016 16:46:48 +0100 Subject: [PATCH 15/17] Add more padding examples --- manual/table/cell_dimensions.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/manual/table/cell_dimensions.rb b/manual/table/cell_dimensions.rb index cd47d78..8fdf3e9 100644 --- a/manual/table/cell_dimensions.rb +++ b/manual/table/cell_dimensions.rb @@ -25,6 +25,12 @@ move_down 20 end - text "Padding can also be set with an array: [0, 0, 0, 30]" - table(data, :cell_style => {:padding => [0, 0, 0, 30]}) + text "Padding can also be set with an array by specifying values for all sides: [0, 0, 0, 30]" + table(data, :cell_style => {:padding => [0, 0, 0, 30]}) # top, right, bottom, left + + text "Padding can also be set by specifying only vertical and horizontal values: [0,30]" + table(data, :cell_style => {:padding => [0, 30]}) # vertical, horizontal + + text "Padding can also be set by specifying top, horizontal and bottom values: [0,30,10]" + table(data, :cell_style => {:padding => [0,30,10]}) # top, horizontal, bottom end From e6b996500fa1f5b497e0290c80427977de121fb8 Mon Sep 17 00:00:00 2001 From: Paulo Fidalgo Date: Wed, 20 Sep 2017 22:14:49 +0100 Subject: [PATCH 16/17] Remove reference to dead examples In the documentation there was a reference to an old example. In this commit we remove it, because it's no longer valid. --- lib/prawn/table.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/prawn/table.rb b/lib/prawn/table.rb index b000d3a..718fe69 100644 --- a/lib/prawn/table.rb +++ b/lib/prawn/table.rb @@ -47,8 +47,7 @@ module Errors # Prawn::Table:: # Creates a subtable (a table within a cell). You can use # Prawn::Document#make_table to create a table for use as a subtable - # without immediately drawing it. See examples/table/bill.rb for a - # somewhat complex use of subtables. + # without immediately drawing it. # Array:: # Creates a simple subtable. Create a Table object using make_table (see # above) if you need more control over the subtable's styling. From 38b5bdb5dd95237646675c968091706f57a7a641 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Thu, 10 Feb 2022 07:52:41 -0800 Subject: [PATCH 17/17] Fix a few lints. --- manual/table/cell_dimensions.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manual/table/cell_dimensions.rb b/manual/table/cell_dimensions.rb index 8fdf3e9..e6bc6f3 100644 --- a/manual/table/cell_dimensions.rb +++ b/manual/table/cell_dimensions.rb @@ -25,12 +25,12 @@ move_down 20 end - text "Padding can also be set with an array by specifying values for all sides: [0, 0, 0, 30]" + text "Padding can also be set with an array by specifying values for all sides: [0, 0, 0, 30]" table(data, :cell_style => {:padding => [0, 0, 0, 30]}) # top, right, bottom, left - - text "Padding can also be set by specifying only vertical and horizontal values: [0,30]" + + text "Padding can also be set by specifying only vertical and horizontal values: [0,30]" table(data, :cell_style => {:padding => [0, 30]}) # vertical, horizontal - - text "Padding can also be set by specifying top, horizontal and bottom values: [0,30,10]" - table(data, :cell_style => {:padding => [0,30,10]}) # top, horizontal, bottom + + text "Padding can also be set by specifying top, horizontal and bottom values: [0,30,10]" + table(data, :cell_style => {:padding => [0, 30, 10]}) # top, horizontal, bottom end