graphvizml 0.6.1 → 0.6.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
  SHA256:
3
- metadata.gz: 70367b15cd9ecda5a2010ca241fdd7e5ff80c3356df9ab7b599c8a4e0a812fc7
4
- data.tar.gz: 8fc13a6a0f08d6786a12327ed39fdb0735d5ff7b7f43359eefd05b6771ca43b4
3
+ metadata.gz: 57e4bd5177b9a6a52b44ac67dce1e976552bf7f3c0d155fcb4370aa867a2db3f
4
+ data.tar.gz: db88a92bb05f7dd7b70fe4ec71ac3554b8ce03d8416a25237c6ac778dff63d7c
5
5
  SHA512:
6
- metadata.gz: 75ba5f6d83152d16c870101bb3157cb5fcd6aa651586992d84f19a34631ce67a5d88601bb9682b5bd3e5881f2374098d59ab400d484bc8bfbb3e39f4470561a4
7
- data.tar.gz: 661c553f24df368c9c8855d9bb98c39dba70d5bf35eba744ca349647847754691a339bbb46457689cd36b080387b3a19e9e0a2de401002ea0ddd4cddfe5b70f5
6
+ metadata.gz: 56018ce66a16026318eb72d0286fb67045488625175255e1e872dff7747eb0558a6e72571c5b7fb362f094b74fadf771267213ffcadb5f01af0c6bbf3ee6a2f9
7
+ data.tar.gz: ad2cfda911d1585ca6d18625d4fdafbb09c867b00e1c09f1950ac1e727dae9858e43a1000778a5d63fc615ea29acde81963693f09d6e54d2729e9f8270ce3598
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/graphvizml.rb CHANGED
@@ -35,24 +35,35 @@ class GraphVizML
35
35
  @fill, @stroke, @text_color = fill, stroke, text_color
36
36
 
37
37
  if obj then
38
+
39
+
40
+ xml = if obj.is_a? Rexle or obj.is_a? Rexle::Element
38
41
 
39
- s = RXFHelper.read(obj).first
42
+ obj.xml
40
43
 
41
- if s =~ /<\?graphvizml\b/ then
42
-
43
- import_string s
44
+ else
44
45
 
45
- else
46
+ s = RXFHelper.read(obj).first
46
47
 
47
- if @debug then
48
- #File.write '/tmp/graphviz.xml', xml
49
- puts('graphvizml xml: ' + s.inspect)
48
+ if s =~ /<\?graphvizml\b/ then
49
+
50
+ import_string s
51
+
52
+ else
53
+
54
+ if @debug then
55
+ #File.write '/tmp/graphviz.xml', xml
56
+ puts('graphvizml xml: ' + s.inspect)
57
+ end
58
+
59
+ s
60
+
50
61
  end
51
62
 
52
- @g = build_from_nodes Domle.new(s)
53
-
54
63
  end
55
64
 
65
+ @g = build_from_nodes Domle.new(xml)
66
+
56
67
  end
57
68
 
58
69
  @css = "
@@ -67,7 +78,9 @@ class GraphVizML
67
78
  def import(obj)
68
79
 
69
80
  s = RXFHelper.read(obj).first
70
- import_string s
81
+ xml = import_string s
82
+ @g = build_from_nodes Domle.new(xml)
83
+ self
71
84
 
72
85
  end
73
86
 
@@ -265,8 +278,6 @@ EOF
265
278
  end
266
279
 
267
280
  xml = LineTree.new(s, root: 'nodes', debug: true).to_xml
268
- @g = build_from_nodes Domle.new(xml)
269
- self
270
281
 
271
282
  end
272
283
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphvizml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file