prawn-svg 0.12.0.12 → 0.15.0.0

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: 9f60ffdf19d946bf97ba8cd7fdf732cdef8f3d6f
4
- data.tar.gz: 3885db032ea679b2993f359cb4728feaad8a7ccd
3
+ metadata.gz: 61181b453d5e28bba30c87c430975b21e5e9876d
4
+ data.tar.gz: c1c1d6ec4e6bb4d60af290a836ed25574dbca760
5
5
  SHA512:
6
- metadata.gz: 65587a6f9fae146ac42583ecf9aebb60671834e92038b2845aaa3c79d7e3e848a47d7526f7cb525cad7b06032b3da500b181966a88bbdc88041a470b80e621e5
7
- data.tar.gz: d3fe9134e90fce9a027f7e8b5d824006ee92a7e9ca6c8d912e509807db95b8b45783bfa11e86eb6436b99e37b090a5a5c4e13eb8e787bfef0fb32233499ea433
6
+ metadata.gz: 766a6cb2dc207b26e433509f1dbdce22055106c05806ff327f4203dc478d6ecfe99308502f2b1964c442d8ac2ecba1df5739593144ff2328e3c5e94aad74d440
7
+ data.tar.gz: 2281ec02f05246f40f4c68497d23f34da10b51ba16c60e76bd1e6d2467b0e1d80326ff76cc05aa244b794784be855f2996ceeeb6ce28465ffcecf66bee469b50
data/README.md CHANGED
@@ -28,29 +28,25 @@ If this value is set to <tt>nil</tt>, prawn-svg will ignore a request for an unk
28
28
 
29
29
  prawn-svg does not support the full SVG specification. It currently supports:
30
30
 
31
- - <tt>line</tt>, <tt>polyline</tt>, <tt>polygon</tt>, and <tt>circle</tt> tags
31
+ - <tt>&lt;line&gt;</tt>, <tt>&lt;polyline&gt;</tt>, <tt>&lt;polygon&gt;</tt>, <tt>&lt;circle&gt;</tt> and <tt>&lt;ellipse&gt;</tt>
32
32
 
33
- - <tt>ellipse</tt> tag (although this seems to be buggy)
33
+ - <tt>&lt;rect&gt;</tt>. Rounded rects are supported, but only one radius is applied to all corners.
34
34
 
35
- - <tt>rect</tt> tag
36
- supports rounded rects, but only one radius is applied to all corners
35
+ - <tt>&lt;path&gt;</tt> supports all commands defined in SVG 1.1, although the
36
+ implementation of elliptical arc is a bit rough at the moment.
37
37
 
38
- - <tt>path</tt> tag
39
- supports moveto, closepath, lineto, horiz lineto, vert lineto, curveto, smooth curveto, quad curveto, smooth quad curveto
40
- does not support elliptical arc
38
+ - <tt>&lt;text&gt;</tt> and <tt>&lt;tspan&gt;</tt> with attributes
39
+ <tt>size</tt>, <tt>text-anchor</tt>, <tt>font-family</tt>, <tt>font-weight</tt>, <tt>dx</tt>, <tt>dy</tt>
41
40
 
42
- - <tt>text</tt> and <tt>tspan</tt> tags
43
- attributes: size, text-anchor, font-family, font-weight, dx, dy
41
+ - <tt>&lt;svg&gt;</tt>, <tt>&lt;g&gt;</tt> and <tt>&lt;symbol&gt;</tt>
44
42
 
45
- - <tt>svg</tt>, <tt>g</tt> and <tt>symbol</tt> tags
43
+ - <tt>&lt;use&gt;</tt>
46
44
 
47
- - <tt>use</tt> tag
45
+ - <tt>&lt;style&gt;</tt>, if css_parser gem is installed on the system (see CSS section below)
48
46
 
49
- - <tt>style</tt> tag, if css_parser gem is installed on the system (see CSS section below)
47
+ - <tt>&lt;image&gt;</tt> with <tt>http:</tt>, <tt>https:</tt> and <tt>data:image/*;base64</tt> schemes
50
48
 
51
- - <tt>image</tt> tag, only with http/https schemes
52
-
53
- - <tt>clipPath</tt> tag
49
+ - <tt>&lt;clipPath&gt;</tt>
54
50
 
55
51
  - attributes/styles: <tt>fill</tt>, <tt>stroke</tt>, <tt>stroke-width</tt>, <tt>opacity</tt>, <tt>fill-opacity</tt>, <tt>stroke-opacity</tt>, <tt>transform</tt>, <tt>clip-path</tt>
56
52
 
@@ -69,7 +65,7 @@ so do not expect too much of it.
69
65
 
70
66
  ## Not supported
71
67
 
72
- prawn-svg does NOT support external references, measurements in en or em, sub-viewports, gradients/patterns or markers.
68
+ prawn-svg does not support external references, measurements in <tt>en</tt> or <tt>em</tt>, sub-viewports, gradients/patterns or markers.
73
69
 
74
70
  ## Configuration
75
71
 
@@ -14,6 +14,8 @@ class Prawn::Svg::Parser::Image
14
14
  def read
15
15
  @data
16
16
  end
17
+ def rewind
18
+ end
17
19
  end
18
20
 
19
21
  def initialize(document)
@@ -1,5 +1,5 @@
1
1
  module Prawn
2
2
  module Svg
3
- VERSION = '0.12.0.12'
3
+ VERSION = '0.15.0.0'
4
4
  end
5
5
  end
data/prawn-svg.gemspec CHANGED
@@ -19,6 +19,6 @@ spec = Gem::Specification.new do |gem|
19
19
  gem.require_paths = ["lib"]
20
20
 
21
21
  gem.add_dependency "prawn", ">= 0.8.4"
22
- gem.add_development_dependency "rspec"
22
+ gem.add_development_dependency "rspec", "~> 2.14.1"
23
23
  gem.add_development_dependency "rake"
24
24
  end
@@ -32,10 +32,7 @@ describe Prawn::Svg::Parser do
32
32
  end
33
33
 
34
34
  def mock_element(name, attributes = {})
35
- e = mock
36
- e.stub!(:name).and_return(name)
37
- e.stub!(:attributes).and_return(attributes)
38
-
35
+ e = double(:name => name, :attributes => attributes)
39
36
  Prawn::Svg::Element.new(@document, e, [], {})
40
37
  end
41
38
 
@@ -8,7 +8,7 @@ describe Prawn::Svg::Parser::Path do
8
8
  describe "command parsing" do
9
9
  it "correctly parses a valid path" do
10
10
  calls = []
11
- @path.stub!(:run_path_command) {|*args| calls << args}
11
+ @path.stub(:run_path_command) {|*args| calls << args}
12
12
  @path.parse("A12.34 -56.78 89B4 5 12-34 -.5.7+3 2.3e3 4e4 4e+4 c31,-2e-5C 6,7 T QX 0 Z")
13
13
 
14
14
  calls.should == [
@@ -2,8 +2,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
2
2
 
3
3
  describe Prawn::Svg::Element do
4
4
  before :each do
5
- e = mock
6
- e.stub!(:attributes).and_return({})
5
+ e = double(:attributes => {})
7
6
 
8
7
  @document = Struct.new(:fallback_font_name, :css_parser, :warnings).new("Courier", nil, [])
9
8
  @element = Prawn::Svg::Element.new(@document, e, [], {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0.12
4
+ version: 0.15.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-13 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 2.14.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 2.14.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement