svgle 0.4.1 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acf0ec9fb3fb6885afbd5d222fa9aa8a5a654f8d
4
- data.tar.gz: 34d003463f89c72f45b2b45c6d95059cecb22ba2
3
+ metadata.gz: 0035b7a329d0266d7835eb7abb684e63f4059388
4
+ data.tar.gz: c118282a95b4e8be45cedb0b911ebfc29e75eba9
5
5
  SHA512:
6
- metadata.gz: 4df021911d792e58c8218cdf71fb78c7093e798dac649b5bb1025becf4d47f5593a0d31884b215da2cebae1b6dbe3f50e6f30224135a67bf3ccadcf6b4324f93
7
- data.tar.gz: 4d3536ce087701469ea2f5374dc121b2ba6ab05612bea4c813ceabb393058b878f3b97758e9d89c46ec87c03443026547bcfc783d058d0ac9d99e2e89b2aeb23
6
+ metadata.gz: 9740c63b294f97e323630499930c2cfb49ae506b8da931d14d50ebb0aec34805d010b2ad0d18b142014381f2ce43813f783ee6478b27e41f5c60d0f4e79babfc
7
+ data.tar.gz: 47a2a349c85171a7b24e20236351931082e231452d8bee3c02dc76e93d768b50d4ff6d19f625a02f9c42bf64d971055114def226d08f00736ee92760556560a1
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -67,13 +67,31 @@ class Svgle < Domle
67
67
 
68
68
  class Image < Element
69
69
 
70
- attr2_accessor *%i(x y width height)
70
+ attr2_accessor *%i(x y width height xlink:href src)
71
71
 
72
72
  def boundary()
73
73
  x1, y1, w, h = [x, y, width, height].map(&:to_i)
74
74
  [x1, y1, x1+w, y1+h]
75
75
  end
76
76
 
77
+ def src=(s)
78
+
79
+ @src = s
80
+
81
+ self.attributes[:'xlink:href'] = if s =~ /^http/ then
82
+
83
+ r, _ = RXFHelper.read(s)
84
+ filepath = '/tmp/' + File.basename(s)
85
+ File.write filepath, r
86
+
87
+ filepath
88
+
89
+ else
90
+ s
91
+ end
92
+
93
+ end
94
+
77
95
  end
78
96
 
79
97
  class Path < Element
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svgle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file