prawn-markup 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.travis.yml +3 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +24 -24
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/lib/prawn/markup.rb +2 -0
- data/lib/prawn/markup/builders/list_builder.rb +4 -2
- data/lib/prawn/markup/builders/nestable_builder.rb +2 -0
- data/lib/prawn/markup/builders/table_builder.rb +3 -1
- data/lib/prawn/markup/elements/cell.rb +2 -0
- data/lib/prawn/markup/elements/item.rb +2 -0
- data/lib/prawn/markup/elements/list.rb +2 -0
- data/lib/prawn/markup/interface.rb +2 -0
- data/lib/prawn/markup/processor.rb +3 -1
- data/lib/prawn/markup/processor/blocks.rb +2 -0
- data/lib/prawn/markup/processor/headings.rb +2 -0
- data/lib/prawn/markup/processor/images.rb +2 -0
- data/lib/prawn/markup/processor/lists.rb +2 -0
- data/lib/prawn/markup/processor/tables.rb +13 -1
- data/lib/prawn/markup/processor/text.rb +2 -0
- data/lib/prawn/markup/support/hash_merger.rb +2 -0
- data/lib/prawn/markup/support/normalizer.rb +2 -0
- data/lib/prawn/markup/support/size_converter.rb +2 -0
- data/lib/prawn/markup/version.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f381738eb8b0791ae8943bce4028ca3578249aa25269d887f3953e6de2ed0075
|
4
|
+
data.tar.gz: 45fd2e6656f9b50a2a3bc40ac67ed52dae462d134a4aa201e3459d00d10226ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14b1b72017fe9fb5b2ed0b0529eb8026203c21a7ec653ec50d25f1cd20533dd72827f97b27f5eff711f08c64b8d6b971105931e3fb645eb0c0a5e8e7ac45c2b0
|
7
|
+
data.tar.gz: f6f8a9a2cdebceece5946f31780d918d63981ff9ad0de5d5db5ecf8e20dc02df26fb2b27da46f98ec50b9c13ef1e4c82017d52f9549dec4229a07e61dbeba4f1
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -9,7 +9,9 @@ env:
|
|
9
9
|
global:
|
10
10
|
- CC_TEST_REPORTER_ID=d70fe39ffb8f2f7c5f837f0133d10a3a1c6784d0dd189153111577b60f74c603
|
11
11
|
|
12
|
-
before_install:
|
12
|
+
before_install:
|
13
|
+
- gem update --system
|
14
|
+
- gem install bundler
|
13
15
|
|
14
16
|
before_script:
|
15
17
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
prawn-markup (0.2.
|
4
|
+
prawn-markup (0.2.1)
|
5
5
|
nokogiri
|
6
6
|
prawn
|
7
7
|
prawn-table
|
@@ -12,22 +12,22 @@ GEM
|
|
12
12
|
Ascii85 (1.0.3)
|
13
13
|
afm (0.2.2)
|
14
14
|
ast (2.4.0)
|
15
|
-
byebug (
|
15
|
+
byebug (11.0.1)
|
16
16
|
diff-lcs (1.3)
|
17
17
|
docile (1.3.2)
|
18
18
|
hashery (2.1.2)
|
19
|
-
jaro_winkler (1.5.
|
19
|
+
jaro_winkler (1.5.4)
|
20
20
|
json (2.2.0)
|
21
21
|
mini_portile2 (2.4.0)
|
22
|
-
nokogiri (1.
|
22
|
+
nokogiri (1.10.5)
|
23
23
|
mini_portile2 (~> 2.4.0)
|
24
|
-
parallel (1.
|
25
|
-
parser (2.6.
|
24
|
+
parallel (1.19.1)
|
25
|
+
parser (2.6.5.0)
|
26
26
|
ast (~> 2.4.0)
|
27
27
|
pdf-core (0.7.0)
|
28
28
|
pdf-inspector (1.3.0)
|
29
29
|
pdf-reader (>= 1.0, < 3.0.a)
|
30
|
-
pdf-reader (2.
|
30
|
+
pdf-reader (2.4.0)
|
31
31
|
Ascii85 (~> 1.0.0)
|
32
32
|
afm (~> 0.2.1)
|
33
33
|
hashery (~> 2.0)
|
@@ -39,36 +39,36 @@ GEM
|
|
39
39
|
prawn-table (0.2.2)
|
40
40
|
prawn (>= 1.3.0, < 3.0.0)
|
41
41
|
rainbow (3.0.0)
|
42
|
-
rake (
|
43
|
-
rspec (3.
|
44
|
-
rspec-core (~> 3.
|
45
|
-
rspec-expectations (~> 3.
|
46
|
-
rspec-mocks (~> 3.
|
47
|
-
rspec-core (3.
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-expectations (3.
|
42
|
+
rake (13.0.1)
|
43
|
+
rspec (3.9.0)
|
44
|
+
rspec-core (~> 3.9.0)
|
45
|
+
rspec-expectations (~> 3.9.0)
|
46
|
+
rspec-mocks (~> 3.9.0)
|
47
|
+
rspec-core (3.9.0)
|
48
|
+
rspec-support (~> 3.9.0)
|
49
|
+
rspec-expectations (3.9.0)
|
50
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-mocks (3.
|
51
|
+
rspec-support (~> 3.9.0)
|
52
|
+
rspec-mocks (3.9.0)
|
53
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-support (3.
|
56
|
-
rubocop (0.
|
54
|
+
rspec-support (~> 3.9.0)
|
55
|
+
rspec-support (3.9.0)
|
56
|
+
rubocop (0.77.0)
|
57
57
|
jaro_winkler (~> 1.5.1)
|
58
58
|
parallel (~> 1.10)
|
59
|
-
parser (>= 2.
|
59
|
+
parser (>= 2.6)
|
60
60
|
rainbow (>= 2.2.2, < 4.0)
|
61
61
|
ruby-progressbar (~> 1.7)
|
62
|
-
unicode-display_width (>= 1.4.0, < 1.
|
62
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
63
63
|
ruby-progressbar (1.10.1)
|
64
64
|
ruby-rc4 (0.1.5)
|
65
|
-
simplecov (0.17.
|
65
|
+
simplecov (0.17.1)
|
66
66
|
docile (~> 1.1)
|
67
67
|
json (>= 1.8, < 3)
|
68
68
|
simplecov-html (~> 0.10.0)
|
69
69
|
simplecov-html (0.10.2)
|
70
70
|
ttfunk (1.5.1)
|
71
|
-
unicode-display_width (1.
|
71
|
+
unicode-display_width (1.6.0)
|
72
72
|
|
73
73
|
PLATFORMS
|
74
74
|
ruby
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/lib/prawn/markup.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Prawn
|
2
4
|
module Markup
|
3
5
|
module Builders
|
4
6
|
class ListBuilder < NestableBuilder
|
5
|
-
BULLET_CHAR = '•'
|
7
|
+
BULLET_CHAR = '•'
|
6
8
|
BULLET_MARGIN = 10
|
7
9
|
CONTENT_MARGIN = 10
|
8
10
|
VERTICAL_MARGIN = 5
|
@@ -65,7 +67,7 @@ module Prawn
|
|
65
67
|
data = item.nodes.map { |n| [normalize_list_item_node(n)] }
|
66
68
|
style = column_cell_style(:content)
|
67
69
|
.merge(borders: [], padding: [0, 0, padding_bottom, 0])
|
68
|
-
pdf.make_table(data, cell_style: style) do
|
70
|
+
pdf.make_table(data, cell_style: style, column_widths: [content_width]) do
|
69
71
|
rows(-1).padding = [0, 0, 0, 0]
|
70
72
|
end
|
71
73
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Prawn
|
2
4
|
module Markup
|
3
5
|
module Builders
|
@@ -169,7 +171,7 @@ module Prawn
|
|
169
171
|
|
170
172
|
def distribute_remaing_width(count)
|
171
173
|
equal_width = (total_width - column_width_sum) / count.to_f
|
172
|
-
return if equal_width
|
174
|
+
return if equal_width.negative?
|
173
175
|
|
174
176
|
column_widths.map! { |width| width || equal_width }
|
175
177
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Prawn
|
2
4
|
module Markup
|
3
5
|
# Processes known HTML tags. Unknown tags are ignored.
|
@@ -78,7 +80,7 @@ module Prawn
|
|
78
80
|
|
79
81
|
def reset
|
80
82
|
@stack = []
|
81
|
-
@text_buffer = ''
|
83
|
+
@text_buffer = +''
|
82
84
|
end
|
83
85
|
|
84
86
|
def append_text(string)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Prawn
|
2
4
|
module Markup
|
3
5
|
module Processor::Tables
|
@@ -26,19 +28,29 @@ module Prawn
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def start_tr
|
31
|
+
return unless current_table
|
32
|
+
|
29
33
|
current_table << []
|
30
34
|
end
|
31
35
|
|
32
36
|
def start_td
|
37
|
+
return unless current_table
|
38
|
+
|
33
39
|
current_table.last << Elements::Cell.new(width: style_properties['width'])
|
34
40
|
end
|
35
41
|
|
36
42
|
def start_th
|
43
|
+
return unless current_table
|
44
|
+
|
37
45
|
current_table.last << Elements::Cell.new(width: style_properties['width'], header: true)
|
38
46
|
end
|
39
47
|
|
40
48
|
def end_td
|
41
|
-
|
49
|
+
if current_table
|
50
|
+
add_cell_text_node(current_cell)
|
51
|
+
else
|
52
|
+
add_current_text
|
53
|
+
end
|
42
54
|
end
|
43
55
|
alias end_th end_td
|
44
56
|
|
data/lib/prawn/markup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn-markup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pascal Zumkehr
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|