prawn_shapes 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +50 -0
- data/VERSION +1 -1
- data/lib/prawn_shapes/arc.rb +1 -1
- data/prawn_shapes.gemspec +6 -6
- data/reference_pdfs/arc.pdf +27 -6
- data/spec/arc_spec.rb +10 -0
- metadata +7 -7
- data/README.rdoc +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b35488acbde8156f042a35dd8330bdded36314db
|
4
|
+
data.tar.gz: 2de1ff93676b7133b89257a75e0ef74b3a35becd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 778cd480fee06d577d5f24b2a740f297ff9d44d4c1d48219cdbb3bb68d8da4d963181d61d733f6680d483b666e620ad44448666c2ff1a5366b21e26d6393198c
|
7
|
+
data.tar.gz: 545d25ee30320720c629ed96513899165cbc675a8af1ad024328f9db6aae1aeaa673ce717f33dc878dc9428f93278cdf8e81aa3f987da53664effe14015f604e
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Shapes library for Prawn
|
2
|
+
|
3
|
+
Available thus far:
|
4
|
+
- star
|
5
|
+
- half_star
|
6
|
+
- arc
|
7
|
+
- pie_slice
|
8
|
+
- half_circle
|
9
|
+
- quarter_circle
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
Install the prawn_shapes gem, then:
|
14
|
+
|
15
|
+
require 'prawn_shapes'
|
16
|
+
|
17
|
+
And:
|
18
|
+
|
19
|
+
pdf.star([x, y], :radius => r)
|
20
|
+
|
21
|
+
pdf.arc_around([x, y], :radius => r, :start_angle => 30, :end_angle => 60)
|
22
|
+
pdf.pie_slice([x, y], :radius => r, :start_angle => 45, :end_angle => 135)
|
23
|
+
pdf.half_circle([x, y], :radius => r, :side => :left)
|
24
|
+
pdf.quarter_circle([x, y], :radius => r, :quadrant => 3)
|
25
|
+
|
26
|
+
The built in prawn magic works:
|
27
|
+
|
28
|
+
pdf.stroke_star([x, y], :radius => r)
|
29
|
+
pdf.fill_star([x, y], :radius => r)
|
30
|
+
pdf.fill_and_stroke_star([x, y], :radius => r)
|
31
|
+
|
32
|
+
See the examples directory for further usage examples.
|
33
|
+
|
34
|
+
## Examples
|
35
|
+
|
36
|
+
[stars](https://github.com/Bluejade/prawn-shapes/raw/master/reference_pdfs/star.pdf)
|
37
|
+
|
38
|
+
[arcs and pies](https://github.com/Bluejade/prawn-shapes/raw/master/reference_pdfs/arc.pdf)
|
39
|
+
|
40
|
+
## Changelog
|
41
|
+
|
42
|
+
2009-12-15 - renamed semi_circle to half_circle because it seems more of a kind with quarter_circle
|
43
|
+
|
44
|
+
2011-02-14 - fixed syntax for Ruby 1.9. incorporated Bundler
|
45
|
+
|
46
|
+
2011-04-05 - added gemspec and published as prawn_shapes. requires Prawn 0.11.1
|
47
|
+
|
48
|
+
2014-07-21 - updated for Prawn 1.1
|
49
|
+
|
50
|
+
2014-09-22 - updated for Prawn 1.2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/lib/prawn_shapes/arc.rb
CHANGED
@@ -128,7 +128,7 @@ module Prawn
|
|
128
128
|
radius = options[:radius]
|
129
129
|
start_degrees = options[:start_angle]
|
130
130
|
end_degrees = options[:end_angle]
|
131
|
-
return if start_degrees == end_degrees
|
131
|
+
return [] if start_degrees == end_degrees
|
132
132
|
|
133
133
|
overall_start_angle = (start_degrees % 360.0).to_radians
|
134
134
|
overall_end_angle = (end_degrees % 360.0).to_radians
|
data/prawn_shapes.gemspec
CHANGED
@@ -2,26 +2,26 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: prawn_shapes 1.2.
|
5
|
+
# stub: prawn_shapes 1.2.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "prawn_shapes"
|
9
|
-
s.version = "1.2.
|
9
|
+
s.version = "1.2.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Daniel Nelson"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2015-04-14"
|
15
15
|
s.description = "Adds additional vector shapes to Prawn"
|
16
16
|
s.email = "daniel@populr.me"
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE",
|
19
|
-
"README.
|
19
|
+
"README.md"
|
20
20
|
]
|
21
21
|
s.files = [
|
22
22
|
"Gemfile",
|
23
23
|
"LICENSE",
|
24
|
-
"README.
|
24
|
+
"README.md",
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
27
|
"examples/example_helper.rb",
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
]
|
40
40
|
s.homepage = "https://github.com/Bluejade/prawn-shapes"
|
41
41
|
s.licenses = ["MIT"]
|
42
|
-
s.rubygems_version = "2.
|
42
|
+
s.rubygems_version = "2.4.3"
|
43
43
|
s.summary = "Additional vector shapes for Prawn"
|
44
44
|
end
|
45
45
|
|
data/reference_pdfs/arc.pdf
CHANGED
@@ -17,7 +17,7 @@ endobj
|
|
17
17
|
>>
|
18
18
|
endobj
|
19
19
|
4 0 obj
|
20
|
-
<< /Length
|
20
|
+
<< /Length 5674
|
21
21
|
>>
|
22
22
|
stream
|
23
23
|
q
|
@@ -78,6 +78,27 @@ b
|
|
78
78
|
489.209 590.547 489.209 590.547 489.209 590.547 c
|
79
79
|
517.414 614.213 524.361 653.614 505.952 685.500 c
|
80
80
|
b
|
81
|
+
0.467 0.467 0.467 SCN
|
82
|
+
0.867 0.867 1.000 scn
|
83
|
+
306.000 558.000 m
|
84
|
+
381.000 558.000 381.000 558.000 381.000 558.000 c
|
85
|
+
381.000 599.421 347.421 633.000 306.000 633.000 c
|
86
|
+
306.000 633.000 306.000 633.000 306.000 633.000 c
|
87
|
+
264.579 633.000 231.000 599.421 231.000 558.000 c
|
88
|
+
231.000 558.000 231.000 558.000 231.000 558.000 c
|
89
|
+
231.000 516.579 264.579 483.000 306.000 483.000 c
|
90
|
+
306.000 483.000 306.000 483.000 306.000 483.000 c
|
91
|
+
347.421 483.000 381.000 516.579 381.000 558.000 c
|
92
|
+
f
|
93
|
+
381.000 558.000 m
|
94
|
+
381.000 599.421 347.421 633.000 306.000 633.000 c
|
95
|
+
306.000 633.000 306.000 633.000 306.000 633.000 c
|
96
|
+
264.579 633.000 231.000 599.421 231.000 558.000 c
|
97
|
+
231.000 558.000 231.000 558.000 231.000 558.000 c
|
98
|
+
231.000 516.579 264.579 483.000 306.000 483.000 c
|
99
|
+
306.000 483.000 306.000 483.000 306.000 483.000 c
|
100
|
+
347.421 483.000 381.000 516.579 381.000 558.000 c
|
101
|
+
S
|
81
102
|
0.867 0.867 1.000 scn
|
82
103
|
171.000 468.000 m
|
83
104
|
171.000 543.000 171.000 543.000 171.000 543.000 c
|
@@ -149,7 +170,7 @@ S
|
|
149
170
|
0.200 0.200 0.200 scn
|
150
171
|
|
151
172
|
BT
|
152
|
-
107.
|
173
|
+
107.82 338.384 Td
|
153
174
|
/F1.0 12 Tf
|
154
175
|
[<4e6f74696365207468652064696666> 30 <6572656e636520696e207374726f6b696e67207768656e207573696e67207374726f6b> 20 <655f2076> 25 <65727375732066696c6c5f616e645f7374726f6b> 20 <653a>] TJ
|
155
176
|
ET
|
@@ -167,7 +188,7 @@ b
|
|
167
188
|
0.200 0.200 0.200 scn
|
168
189
|
|
169
190
|
BT
|
170
|
-
91.
|
191
|
+
91.584 230.38400000000001 Td
|
171
192
|
/F1.0 12 Tf
|
172
193
|
[<49662079> 20 <6f752077> 15 <616e7420746f207374726f6b> 20 <6520626f7468207369646573207768656e207374726f6b696e6720696e636c756465203a7374726f6b> 20 <655f626f74685f7369646573203d3e207472> -15 <7565>] TJ
|
173
194
|
ET
|
@@ -206,13 +227,13 @@ xref
|
|
206
227
|
0000000109 00000 n
|
207
228
|
0000000158 00000 n
|
208
229
|
0000000215 00000 n
|
209
|
-
|
210
|
-
|
230
|
+
0000005941 00000 n
|
231
|
+
0000006119 00000 n
|
211
232
|
trailer
|
212
233
|
<< /Size 7
|
213
234
|
/Root 2 0 R
|
214
235
|
/Info 1 0 R
|
215
236
|
>>
|
216
237
|
startxref
|
217
|
-
|
238
|
+
6216
|
218
239
|
%%EOF
|
data/spec/arc_spec.rb
CHANGED
@@ -61,6 +61,16 @@ describe 'Graphics#arc_around' do
|
|
61
61
|
curve.coords.length.should > 0
|
62
62
|
end
|
63
63
|
end
|
64
|
+
|
65
|
+
context 'when the specified angles are the same' do
|
66
|
+
it 'should work' do
|
67
|
+
create_pdf
|
68
|
+
@pdf.arc_around([100, 100], :radius => 50,
|
69
|
+
:start_angle => 90, :end_angle => 90)
|
70
|
+
curve = PDF::Inspector::Graphics::Curve.analyze(@pdf.render)
|
71
|
+
curve.coords.length.should eq 0
|
72
|
+
end
|
73
|
+
end
|
64
74
|
end
|
65
75
|
|
66
76
|
describe 'Graphics#half_circle' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn_shapes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Adds additional vector shapes to Prawn
|
14
14
|
email: daniel@populr.me
|
@@ -16,11 +16,11 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files:
|
18
18
|
- LICENSE
|
19
|
-
- README.
|
19
|
+
- README.md
|
20
20
|
files:
|
21
21
|
- Gemfile
|
22
22
|
- LICENSE
|
23
|
-
- README.
|
23
|
+
- README.md
|
24
24
|
- Rakefile
|
25
25
|
- VERSION
|
26
26
|
- examples/example_helper.rb
|
@@ -45,17 +45,17 @@ require_paths:
|
|
45
45
|
- lib
|
46
46
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '0'
|
51
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.
|
58
|
+
rubygems_version: 2.4.3
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Additional vector shapes for Prawn
|
data/README.rdoc
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
= Shapes library for Prawn
|
2
|
-
|
3
|
-
Available thus far:
|
4
|
-
- star
|
5
|
-
- half_star
|
6
|
-
- arc
|
7
|
-
- pie_slice
|
8
|
-
- half_circle
|
9
|
-
- quarter_circle
|
10
|
-
|
11
|
-
= Usage
|
12
|
-
|
13
|
-
Install the prawn_shapes gem, then:
|
14
|
-
|
15
|
-
require 'prawn_shapes'
|
16
|
-
|
17
|
-
And:
|
18
|
-
|
19
|
-
pdf.star([x, y], :radius => r)
|
20
|
-
|
21
|
-
pdf.arc_around([x, y], :radius => r, :start_angle => 30, :end_angle => 60)
|
22
|
-
pdf.pie_slice([x, y], :radius => r, :start_angle => 45, :end_angle => 135)
|
23
|
-
pdf.half_circle([x, y], :radius => r, :side => :left)
|
24
|
-
pdf.quarter_circle([x, y], :radius => r, :quadrant => 3)
|
25
|
-
|
26
|
-
The built in prawn magic works:
|
27
|
-
|
28
|
-
pdf.stroke_star([x, y], :radius => r)
|
29
|
-
pdf.fill_star([x, y], :radius => r)
|
30
|
-
pdf.fill_and_stroke_star([x, y], :radius => r)
|
31
|
-
|
32
|
-
See the examples directory for further usage examples.
|
33
|
-
|
34
|
-
= Examples
|
35
|
-
|
36
|
-
stars: https://github.com/downloads/Bluejade/prawn-shapes/star.pdf
|
37
|
-
|
38
|
-
arcs and pies: https://github.com/downloads/Bluejade/prawn-shapes/arc.pdf
|
39
|
-
|
40
|
-
= Changelog
|
41
|
-
|
42
|
-
2009-12-15 - renamed semi_circle to half_circle because it seems more of a kind with quarter_circle
|
43
|
-
|
44
|
-
2011-02-14 - fixed syntax for Ruby 1.9. incorporated Bundler
|
45
|
-
|
46
|
-
2011-04-05 - added gemspec and published as prawn_shapes. requires Prawn 0.11.1
|
47
|
-
|
48
|
-
2014-07-21 - updated for Prawn 1.1
|
49
|
-
|
50
|
-
2014-09-22 - updated for Prawn 1.2
|