svgle 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7aaac0d75a831fb3552d93092087d2e2bcf51c57
4
+ data.tar.gz: 10d92c3640d96d8a5e97eb00ba7de32ed895c2c8
5
+ SHA512:
6
+ metadata.gz: 13444cd92dc776b6a799745e8cd352e81280bdaa55f89a8fab0e8ba5caeaf6f2c7170d17bb0181348f7ffcf305bbc589672e50ec5b338109beaf9e028033cdeb
7
+ data.tar.gz: ee392d0e8041980154cb63b8c9fd148116914c833f28a9c4ed16315a0e1e4c0e46a1e6e787e10961fe849a60497bcbc676448a05ad9deee81fc29c34c73171e8
Binary file
@@ -0,0 +1 @@
1
+ "n���{}��x��I��ar�(g9�Exy�
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: svgle.rb
4
+
5
+ require 'rexle'
6
+
7
+
8
+ class Svgle < Rexle
9
+
10
+ class Element < Rexle::Element
11
+ end
12
+
13
+ class G < Element
14
+ end
15
+
16
+ class Line < Element
17
+ def x1()
18
+ attributes[:x1]
19
+ end
20
+ def x1=(v)
21
+ attributes[:x1] = v
22
+ end
23
+ end
24
+
25
+ class Svg < Element
26
+ end
27
+
28
+
29
+ def scan_element(name, attributes=nil, *children)
30
+
31
+ return Rexle::CData.new(children.first) if name == '!['
32
+ return Rexle::Comment.new(children.first) if name == '!-'
33
+
34
+ type = {
35
+ line: Svgle::Line,
36
+ g: Svgle::G,
37
+ svg: Svgle::Svg,
38
+ doc: Rexle::Element
39
+ }
40
+
41
+ element = type[name.to_sym].new(name, attributes: attributes, rexle: self)
42
+
43
+ if children then
44
+
45
+ children.each do |x|
46
+ if x.is_a? Array then
47
+
48
+ element.add_element scan_element(*x)
49
+ elsif x.is_a? String then
50
+
51
+ e = if x.is_a? String then
52
+
53
+ x
54
+ elsif x.name == '![' then
55
+
56
+ Rexle::CData.new(x)
57
+
58
+ elsif x.name == '!-' then
59
+
60
+ Rexle::Comment.new(x)
61
+
62
+ end
63
+
64
+ element.add_element e
65
+ end
66
+ end
67
+ end
68
+
69
+ return element
70
+ end
71
+
72
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: svgle
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE1MTEyMjE0NTUwNVoXDTE2MTEyMTE0NTUwNVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBANDuW856WZZpA1PLfpIo77MV41HlplCQ0q135tRxG4v3MgsVGdqwIivfC1y3
19
+ zgdRhDNnGTYVNNf/jPa2hHSMPDLdk1uQHGltQudiWIsqHzsEmtAh0PL70OuoRlpw
20
+ SlC0oq4crlmltkWf6GXvRsVBuUvauLp+bVKbHUUlwufT1K+0aNR44wuYH9Re2O/w
21
+ HmsbodrFMiHdHYNTobYHGRWtLaTkTDDXSKX/slf9CDtVbpN6NP5jtOdb3K5IRR11
22
+ ernTMxXS8XUQsWNp1J30ETLvvvUN5eDX5w+CH20HQvawaQfZpJurYEjF50+Z5UTm
23
+ 5r3pGW4O+GA9SI91UcMHuDygSOUCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQU5LUyec+nEI7ULjJQYhOwmUtIT3UwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAtXM2Qiuv
27
+ 1/Z4byIeAsMOkLGnAWmZScPkO7XMB09QwqLvMbz6Ys5IQZ//GwAKLc1qsZVL6BRf
28
+ FA28i4v1XfcrLRMZ42FDcr8aI4x8K8CxOFKydHr8jmX9F1rMt4aEE6Mi3LysYSh3
29
+ slaZG4lEbjfUsYYeewmxy8U5HEfonHuYm7PcOFrkNrU7DQB93lyZOH60UN/ZCA+F
30
+ DWUpv6GtQPvWSMAoqYSXmiJS9HvBVYExu3xe+4r0lZSvdhlFrr53wxnCsxM3rqgf
31
+ RmHuiq+pC3w5bbeKAS7PA41oFYzip80UozdgPsTbPSjT38fz3RwuIKWLTG0zOXty
32
+ rUf4C1wr3bOSgQ==
33
+ -----END CERTIFICATE-----
34
+ date: 2015-11-22 00:00:00.000000000 Z
35
+ dependencies: []
36
+ description:
37
+ email: james@r0bertson.co.uk
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - lib/svgle.rb
43
+ homepage: https://github.com/jrobertson/svgle
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.4.8
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: svgle
67
+ test_files: []
Binary file