pxgraphviz 0.2.1 → 0.2.2

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: 18239393b6c66a8f5d816b7979cafd2c20b776cc
4
- data.tar.gz: db793639ff4f60ce8ea1246f17e0a636ed54a136
3
+ metadata.gz: 7952606d723dd8857ce9bd5511ccc8b5bcd10276
4
+ data.tar.gz: 157b4f7889a2ae7345cd705a8bc49a21446da7bd
5
5
  SHA512:
6
- metadata.gz: 5a8db895f10a0174f897482dd4080fc84b27e2d4209bdd509c8ad8a7dbf2d44999cbc6faa1f4fed950d2c32411a541c2549f4c68da08541fc957c244171c2855
7
- data.tar.gz: c97211de382c436263fca20e502ece8e99b4e881c854463bd581d525d504216df0414b447c61417b94c2701861fa59b11891b67123652f1b9afb0e6706eaf2fd
6
+ metadata.gz: cfccd7cce7e4d58a2b5ba517d1d47f9e74c59a8abcac2fc2a70d9fbd0ca8c0a5db9c58775e2dc6b1fbad6f9dff86e249f01be059879855fa5471b6b0db2621a5
7
+ data.tar.gz: cf428374d2e9e842dd8f28cac080bb06fd94390cf8d5c5a98363a8ee9adf2555e8d7cdfe53b2ea57a180df7009f4564a931e56ff72651a132a5dc91715068438
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -12,7 +12,7 @@ class PxGraphViz
12
12
  def initialize(s)
13
13
 
14
14
  if s =~ /^<\?/ then
15
-
15
+
16
16
  @px = Polyrex.new
17
17
  @px.import s
18
18
 
@@ -25,6 +25,7 @@ class PxGraphViz
25
25
 
26
26
  def to_doc()
27
27
 
28
+ # The issue with 2 nodes having the same name has yet to be rectified
28
29
  #jr020917 labels = @px.xpath('//records/item/summary/label/text()').uniq
29
30
 
30
31
  summary = @px.xpath('//records/item/summary')
@@ -64,7 +65,11 @@ class PxGraphViz
64
65
  @px.each_recursive do |x, parent, level|
65
66
 
66
67
  next if level <= 0
67
- a_edges << [parent.label, x.label, x.connection]
68
+ a_edges << [
69
+ parent.label,
70
+ x.label,
71
+ x.respond_to?(:connection) ? x.connection : ''
72
+ ]
68
73
 
69
74
  end
70
75
 
@@ -88,7 +93,7 @@ class PxGraphViz
88
93
  end
89
94
 
90
95
 
91
- style = '
96
+ style =<<STYLE
92
97
  node {
93
98
  color: #ddaa66;
94
99
  fillcolor: #775500;
@@ -107,10 +112,10 @@ style = '
107
112
  fontcolor: #444444;
108
113
  fontname: Verdana;
109
114
  fontsize: 8;
110
- dir: forward;
115
+ #{@type == :digraph ? 'dir: forward;' : ''}
111
116
  weight: 1;
112
117
  }
113
- '
118
+ STYLE
114
119
  h = {
115
120
  style: style,
116
121
  nodes: {summary: '', records: node_records[3..-1]},
@@ -119,7 +124,12 @@ style = '
119
124
 
120
125
  a = RexleBuilder.new(h).to_a
121
126
  a[0] = 'gvml'
122
- a[1] = {direction: @px.summary.direction} if @px.summary.direction
127
+
128
+ summary = @px.summary.to_h
129
+
130
+ a[1] = %i(type direction).inject({}) do |r,x|
131
+ r.merge(x => summary[x]) if summary.has_key? x
132
+ end
123
133
 
124
134
  Rexle.new(a)
125
135
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxgraphviz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  AJ2kmROiYBLscpVrfyHxtEJluJwbid/KyR/BybHL7uezZ2/EbCxCYanOIbNyctTp
32
32
  CNgZvs+F41zO7g==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-09-02 00:00:00.000000000 Z
34
+ date: 2017-09-03 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: polyrex
metadata.gz.sig CHANGED
Binary file