svgle 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/svgle.rb +19 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0035b7a329d0266d7835eb7abb684e63f4059388
|
4
|
+
data.tar.gz: c118282a95b4e8be45cedb0b911ebfc29e75eba9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9740c63b294f97e323630499930c2cfb49ae506b8da931d14d50ebb0aec34805d010b2ad0d18b142014381f2ce43813f783ee6478b27e41f5c60d0f4e79babfc
|
7
|
+
data.tar.gz: 47a2a349c85171a7b24e20236351931082e231452d8bee3c02dc76e93d768b50d4ff6d19f625a02f9c42bf64d971055114def226d08f00736ee92760556560a1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/svgle.rb
CHANGED
@@ -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
metadata.gz.sig
CHANGED
Binary file
|