proforma-prawn-renderer 1.0.1 → 1.0.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
  SHA256:
3
- metadata.gz: 88ca0d13f9884dd190ce244d240879aff8f1724e378863141ff01daa1d4eccad
4
- data.tar.gz: 565d3d7a0b97cf85130267cc40d86e2972e3d99322e0ceab4d2a96efcaca9222
3
+ metadata.gz: d353eb183e887bb3f96ea8d3c79cfc113fef27bf2057042b717e881dc445252b
4
+ data.tar.gz: f71dc344909b7b68c44702b6cd2e4124a7849cfe2477e96e802a314734baa954
5
5
  SHA512:
6
- metadata.gz: 3ef308ba484ddcea35c9e9a717cad254c2abadcc8e4ec219b84342c01fb92cdf771384c602829286d86a818ddbc5b113c61a91693d28454de38d6df4a1340bc0
7
- data.tar.gz: 3d1a9b4c50e0c85eeef9055b5b0f3727921f3b14d2086699da9e4d37397c28fd88b2125c518ce13b992c7a02d1886c97b879215ea3e85b28f9bb7b2916c73c30
6
+ metadata.gz: 41b223807262ed034c8a2ff0cf81c19bd1390993e202655d17ec306ed5306ffa108bf346d2c8845866d5625b5e8159d414dd440e57fae9d0addc52c3f8a9d1e8
7
+ data.tar.gz: fda9c314d671fb2671ce73164a5081d35c996c8c689f141ef55c7049c1255e66bea2017c5ebcb12ed88f109bd5b5d8d89c932c7ffe5af404dd455a63aa81071d
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  *.gem
3
3
  /tmp
4
4
  /coverage
5
+ /pkg
data/.rubocop.yml CHANGED
@@ -3,6 +3,8 @@ Metrics/LineLength:
3
3
 
4
4
  Metrics/BlockLength:
5
5
  ExcludedMethods: ['let', 'it', 'describe', 'context', 'specify']
6
+ Exclude:
7
+ - proforma-prawn-renderer.gemspec
6
8
 
7
9
  Metrics/MethodLength:
8
10
  Max: 25
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ # 1.0.2 (June 14th, 2019)
2
+
3
+ * Added overflow and min_font_size attributes to cell_style for tables.
4
+ * Fixed bug where value_width was not being honored.
5
+
6
+ # 1.0.1 (May 27th, 2019)
7
+
8
+ * Fixed rendering bug when Pane has 0 columns
9
+ * Fixed rendering bug when Pane Column has 0 lines
10
+ * Fixed cell styling issue for Panes with un-even number of lines in columns.
11
+
1
12
  # 1.0.0 (April 26th, 2019)
2
13
 
3
14
  Initial Release.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proforma-prawn-renderer (1.0.1)
4
+ proforma-prawn-renderer (1.0.2)
5
5
  prawn (~> 2)
6
6
  prawn-table (~> 0)
7
7
  proforma (~> 1)
@@ -64,8 +64,10 @@ module Proforma
64
64
  def cell_style
65
65
  @cell_style ||= {
66
66
  border_width: 0,
67
- padding: 0,
68
67
  font: font_name,
68
+ min_font_size: 1,
69
+ overflow: :shrink_to_fit,
70
+ padding: 0,
69
71
  size: text_font_size
70
72
  }
71
73
  end
@@ -78,22 +78,26 @@ module Proforma
78
78
  end
79
79
 
80
80
  def make_column_widths(columns)
81
- column_widths = {}
81
+ {}.tap do |column_widths|
82
+ columns.each_with_index do |column, index|
83
+ label_width = column.label_width
84
+ value_width = column.value_width
82
85
 
83
- columns.each_with_index do |column, index|
84
- label_width = column.label_width
85
- next unless label_width
86
+ label_index = index * 2
87
+ value_index = label_index + 1
86
88
 
87
- column_widths[index * 2] = calculate_width(label_width)
89
+ column_widths[label_index] = calculate_width(label_width) if label_width
90
+ column_widths[value_index] = calculate_width(value_width) if value_width
91
+ end
88
92
  end
89
-
90
- column_widths
91
93
  end
92
94
 
93
95
  def base_value_cell_style
94
96
  @base_value_cell_style ||= {
95
97
  border_width: 0,
96
98
  font: font_name,
99
+ min_font_size: 1,
100
+ overflow: :shrink_to_fit,
97
101
  padding: [2, 0, 2, 2],
98
102
  size: text_font_size
99
103
  }
@@ -101,8 +105,8 @@ module Proforma
101
105
 
102
106
  def base_label_cell_style
103
107
  @base_label_cell_style ||= base_value_cell_style.merge(
104
- padding: [2, 2, 2, 0],
105
- font_style: bold_font_style
108
+ font_style: bold_font_style,
109
+ padding: [2, 2, 2, 0]
106
110
  )
107
111
  end
108
112
  end
@@ -60,6 +60,8 @@ module Proforma
60
60
  @cell_style ||= {
61
61
  border_width: 0.5,
62
62
  font: font_name,
63
+ min_font_size: 1,
64
+ overflow: :shrink_to_fit,
63
65
  padding: 3,
64
66
  size: text_font_size
65
67
  }
@@ -9,6 +9,6 @@
9
9
 
10
10
  module Proforma
11
11
  class PrawnRenderer
12
- VERSION = '1.0.1'
12
+ VERSION = '1.0.2'
13
13
  end
14
14
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.summary = 'Proforma renderer plugin for generating PDFs using Prawn'
9
9
 
10
10
  s.description = <<-DESCRIPTION
11
-
11
+ Proforma is a virtual document object model. This library allows you to output PDF for a virtual Proforma document.
12
12
  DESCRIPTION
13
13
 
14
14
  s.authors = ['Matthew Ruggio']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proforma-prawn-renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-27 00:00:00.000000000 Z
11
+ date: 2019-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -178,7 +178,8 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: 0.4.2
181
- description: "\n"
181
+ description: " Proforma is a virtual document object model. This library allows
182
+ you to output PDF for a virtual Proforma document.\n"
182
183
  email:
183
184
  - mruggio@bluemarblepayroll.com
184
185
  executables: