prawn-table 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dffd18da56117b0ba3d22b8691620b960b8f6151
4
- data.tar.gz: e51d2b9241a3452fe77a02f9ab7e16beafb65d37
3
+ metadata.gz: bdd445559cd79a07720ef66b367f35ee02459386
4
+ data.tar.gz: 25fe46a4a1b7b6d44a148410738b68ff85cb89b1
5
5
  SHA512:
6
- metadata.gz: d8c3e2bc4fad0b2f3ce1070f125089bc752ca00a8a5f94ab4cc9a89f4f321a7a4a33dab5a2aa1211df1648ab32d9e6bc4b4cb92f80c8ecee4f259b7f1f769929
7
- data.tar.gz: 733bc2009f73443d04a435b366b91363b84640cb773ab0f2fa45d4f28f92b2bf000dfab5c7464b16e4315ee6f42ccaae708a7c24b79fd522a251e81df8a2a367
6
+ metadata.gz: b76fb3bb2a2b9162567635bf03796e60abd2b259496c9c9e63d5274ca6855ef073612d0c44742be64f447cb74de2b94904852d8e4f1f08df19df88fad7eed7a0
7
+ data.tar.gz: 659119d602c5a3b99dac86f6975297816f0fd29c9aef0eac539e0fd859ab0bd22fc673eab05aba47945b167132d2cec6670ca288de403acd46d125de630152f3
@@ -7,6 +7,7 @@
7
7
  # This is free software. Please see the LICENSE and COPYING files for details.
8
8
 
9
9
 
10
+ require 'prawn'
10
11
  require_relative 'table/column_width_calculator'
11
12
  require_relative 'table/cell'
12
13
  require_relative 'table/cells'
@@ -710,11 +710,11 @@ module Prawn
710
710
  # Draws the cell's background color.
711
711
  #
712
712
  def draw_background(pt)
713
- if defined?(@background_color) && @background_color
714
- @pdf.mask(:fill_color) do
715
- @pdf.fill_color @background_color
716
- @pdf.fill_rectangle pt, width, height
717
- end
713
+ return unless background_color
714
+
715
+ @pdf.mask(:fill_color) do
716
+ @pdf.fill_color background_color
717
+ @pdf.fill_rectangle pt, width, height
718
718
  end
719
719
  end
720
720
 
@@ -1,5 +1,5 @@
1
1
  module Prawn
2
2
  class Table
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.freeze
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.rubyforge_project = "prawn"
20
20
  spec.licenses = ['RUBY', 'GPL-2', 'GPL-3']
21
21
 
22
- spec.add_development_dependency('prawn', '>= 1.3.0', '< 3.0.0')
22
+ spec.add_dependency('prawn', '>= 1.3.0', '< 3.0.0')
23
23
  spec.add_development_dependency('pdf-inspector', '~> 1.1.0')
24
24
  spec.add_development_dependency('yard')
25
25
  spec.add_development_dependency('rspec', '2.14.1')
@@ -12,7 +12,6 @@ if ENV["COVERAGE"]
12
12
  end
13
13
  end
14
14
 
15
- require "prawn"
16
15
  require_relative "../lib/prawn/table"
17
16
 
18
17
  Prawn.debug = true
@@ -6,12 +6,21 @@ require 'set'
6
6
  describe "Prawn::Table::Cell::SpanDummy" do
7
7
  before(:each) do
8
8
  @pdf = Prawn::Document.new
9
- @table = @pdf.table([[{:content => "Row", :colspan => 2}]])
10
- @master_cell = @table.cells[0,0]
11
- @span_dummy = @master_cell.dummy_cells.first
9
+ @table = @pdf.table([
10
+ [{:content => "A1-2", :colspan => 2}, {:content => "A-B3", :rowspan => 2}],
11
+ [{:content => "B1-2", :colspan => 2}]
12
+ ], :row_colors => [nil, 'EFEFEF'])
13
+ @colspan_master = @table.cells[0,0]
14
+ @colspan_dummy = @colspan_master.dummy_cells.first
15
+ @rowspan_master = @table.cells[0,2]
16
+ @rowspan_dummy = @table.cells[1,2]
12
17
  end
13
18
 
14
- it "delegates background_color to the master cell" do
15
- @span_dummy.background_color.should == @master_cell.background_color
19
+ it "colspan dummy delegates background_color to the master cell" do
20
+ @colspan_dummy.background_color.should == @colspan_master.background_color
21
+ end
22
+
23
+ it "rowspan dummy delegates background_color to the master cell" do
24
+ @rowspan_dummy.background_color.should == @rowspan_master.background_color
16
25
  end
17
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Brown
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-10-31 00:00:00.000000000 Z
16
+ date: 2015-07-16 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: prawn
@@ -25,7 +25,7 @@ dependencies:
25
25
  - - "<"
26
26
  - !ruby/object:Gem::Version
27
27
  version: 3.0.0
28
- type: :development
28
+ type: :runtime
29
29
  prerelease: false
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  version: 1.3.6
225
225
  requirements: []
226
226
  rubyforge_project: prawn
227
- rubygems_version: 2.2.2
227
+ rubygems_version: 2.4.5
228
228
  signing_key:
229
229
  specification_version: 4
230
230
  summary: Provides tables for PrawnPDF