rviz 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +78 -0
- data/Rakefile +4 -0
- data/examples/hello.png +0 -0
- data/examples/hello.rb +4 -0
- data/examples/record.png +0 -0
- data/examples/record.rb +13 -0
- data/lib/rviz/edge.rb +30 -0
- data/lib/rviz/graph.rb +96 -0
- data/lib/rviz/node.rb +20 -0
- data/lib/rviz/record.rb +57 -0
- data/lib/rviz/version.rb +4 -0
- data/lib/rviz.rb +32 -0
- data/rviz.gemspec +16 -0
- data/spec/edge_spec.rb +38 -0
- data/spec/graph_spec.rb +7 -0
- data/spec/node_spec.rb +61 -0
- data/spec/rviz_helper_spec.rb +19 -0
- data/spec/spec_helper.rb +7 -0
- data/tags +33 -0
- metadata +91 -0
data/README.rdoc
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
= Rviz: An Other Ruby Interface for Graphviz
|
2
|
+
|
3
|
+
Provide a simple OOP interface and designed easy to extend.
|
4
|
+
|
5
|
+
g = Rviz::Graph.new
|
6
|
+
g.set('bgcolor', 'kahki')
|
7
|
+
g.set('dpi', '300')
|
8
|
+
g.set('rankdir', 'LR')
|
9
|
+
node_a = g.add_node('Node A', 'diamond')
|
10
|
+
node_b = g.add_node('Node B', 'box')
|
11
|
+
edge_a = g.add_edge('Node A', '', 'Node B', '', {arrowhead: 'onormal'})
|
12
|
+
|
13
|
+
node_a.set('fillcolor', 'yellow')
|
14
|
+
g.node('Node A').set('fillcolor', 'yellow') # same as above
|
15
|
+
|
16
|
+
other_node = Rviz::Node.new('The Node', 'diamond')
|
17
|
+
g.add(other_node) # same as g.add_node(...)
|
18
|
+
|
19
|
+
g.output('some.dot') # generate a dot file
|
20
|
+
g.output # send output to STDOUT
|
21
|
+
|
22
|
+
An easy way to create <tt>record</tt> and <tt>Mrecord</tt> type of nodes:
|
23
|
+
|
24
|
+
g.add_record('Record A')
|
25
|
+
g.node('Record A').add_row('A Row 1', true) # add an anchor
|
26
|
+
g.node('Record A').add_row('A Row 2', true) # add an anchor
|
27
|
+
g.node('Record A').add_row('A Row 3', true) # add an anchor
|
28
|
+
|
29
|
+
g.add_record('Record B')
|
30
|
+
g.node('Record B').add_row('B Row 1', true) # add an anchor
|
31
|
+
g.add_edge('Record A', 'A Row 2', 'Record B', 'B Row 1', {label: 'link A:2 to B:1'})
|
32
|
+
|
33
|
+
You can extend <tt>Rviz</tt> very easy:
|
34
|
+
|
35
|
+
# in file red_note.rb
|
36
|
+
module Rviz
|
37
|
+
class RedNote < Note
|
38
|
+
def initialize name
|
39
|
+
@attrs[:name] = name
|
40
|
+
@attrs[:shape] = 'note'
|
41
|
+
@attrs[:style] = 'filled'
|
42
|
+
@attrs[:fillcolor] = 'red'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# in your program:
|
48
|
+
g = Rviz::Graph.new
|
49
|
+
g.add(Rviz::RedNote.new('Red'))
|
50
|
+
g.output('notes.dot')
|
51
|
+
|
52
|
+
And you can also mixin the <tt>Graph</tt> class:
|
53
|
+
|
54
|
+
# in file red_note.rb
|
55
|
+
module Rviz
|
56
|
+
class RedNote < Note
|
57
|
+
def initialize name
|
58
|
+
@attrs[:name] = name
|
59
|
+
@attrs[:shape] = 'note'
|
60
|
+
@attrs[:style] = 'filled'
|
61
|
+
@attrs[:fillcolor] = 'red'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
module Rviz
|
67
|
+
class Graph
|
68
|
+
def add_red_note name
|
69
|
+
self.add(RedNote(name))
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# now in your main program:
|
75
|
+
g = Rviz::Graph.new
|
76
|
+
g.add_red_note('Bloody Notes')
|
77
|
+
g.output('notes.dot')
|
78
|
+
|
data/Rakefile
ADDED
data/examples/hello.png
ADDED
Binary file
|
data/examples/hello.rb
ADDED
data/examples/record.png
ADDED
Binary file
|
data/examples/record.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
$:.unshift "lib", "../lib"
|
3
|
+
require 'rviz'
|
4
|
+
|
5
|
+
g = Rviz::Graph.new
|
6
|
+
g.add(Rviz::Record.new('To', {color: 'blue'}))
|
7
|
+
g.add(Rviz::Mrecord.new('Fu', {color: 'green'}))
|
8
|
+
|
9
|
+
g.node('To').add_row("Hello").add_row("World", true)
|
10
|
+
g.node('Fu').add_row("你好", true).add_row("世界")
|
11
|
+
|
12
|
+
g.link('To', "World", 'Fu', "你好")
|
13
|
+
g.output
|
data/lib/rviz/edge.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
module Rviz
|
2
|
+
# represent a ->
|
3
|
+
class Edge
|
4
|
+
attr_reader :attrs
|
5
|
+
|
6
|
+
def initialize from_node, from_anchor, to_node, to_anchor = nil, attributes = {}
|
7
|
+
@from, @from_anchor, @to, @to_anchor, @attrs = from_node, from_anchor, to_node, to_anchor, attributes
|
8
|
+
end
|
9
|
+
|
10
|
+
def node_anchor node, anchor
|
11
|
+
if anchor and anchor.size > 0
|
12
|
+
quote(node) + ":" + anchor
|
13
|
+
else
|
14
|
+
quote(node)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
include Helper
|
19
|
+
|
20
|
+
# output to dot format
|
21
|
+
def to_s
|
22
|
+
from, to = node_anchor(@from, @from_anchor), node_anchor(@to, @to_anchor)
|
23
|
+
if @attrs.keys.size > 0
|
24
|
+
sprintf "%s -> %s [%s]", from, to, self.attrs_to_s
|
25
|
+
else
|
26
|
+
sprintf "%s -> %s", from, to
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/rviz/graph.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
module Rviz
|
2
|
+
class Graph
|
3
|
+
attr_accessor :subgraphs, :nodes, :edges
|
4
|
+
|
5
|
+
def initialize attrs = {}
|
6
|
+
@attrs = attrs
|
7
|
+
@nodes = Hash.new
|
8
|
+
@edges = Array.new
|
9
|
+
@links = Array.new
|
10
|
+
@subgraphs = Hash.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def graph_start type = "digraph", name = "G"
|
14
|
+
"#{type} #{name} {"
|
15
|
+
end
|
16
|
+
|
17
|
+
def graph_end; "}" end
|
18
|
+
|
19
|
+
include Rviz::Helper
|
20
|
+
def graph_attr
|
21
|
+
@attrs["charset"] = "UTF-8" unless @attrs["charset"]
|
22
|
+
sprintf(" graph [%s]", self.attrs_to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
def node_attr
|
26
|
+
' node [fontname="Arial Unicode MS", fontsize=9, width=2.0];'
|
27
|
+
end
|
28
|
+
|
29
|
+
def edge_attr
|
30
|
+
' edge [fontname="Arial Unicode MS", fontsize=7];'
|
31
|
+
end
|
32
|
+
|
33
|
+
# return a specific node from the node list
|
34
|
+
def node name
|
35
|
+
@nodes[name]
|
36
|
+
end
|
37
|
+
|
38
|
+
# add a node or create a node with name, shae and attributes
|
39
|
+
def add name, shape='box', attrs = {}
|
40
|
+
if name.is_a?(Node)
|
41
|
+
node = name
|
42
|
+
name = name.name
|
43
|
+
else
|
44
|
+
node = Node.new(name, shape, attrs)
|
45
|
+
end
|
46
|
+
|
47
|
+
@nodes[name] = node
|
48
|
+
self
|
49
|
+
end
|
50
|
+
|
51
|
+
# create edge between two nodes
|
52
|
+
def link from_name, from_anchor, to_name, to_anchor = "", attrs = {}
|
53
|
+
@links << [from_name, from_anchor, to_name, to_anchor, attrs]
|
54
|
+
self
|
55
|
+
end
|
56
|
+
|
57
|
+
def add_edge from_name, from_anchor, to_name, to_anchor, attrs = {}
|
58
|
+
@edges << Edge.new(from_name, from_anchor, to_name, to_anchor, attrs)
|
59
|
+
self
|
60
|
+
end
|
61
|
+
|
62
|
+
## output dot language source to file or to STDOUT
|
63
|
+
def output file=STDOUT
|
64
|
+
fh = file
|
65
|
+
fh = File.open(file, "w:utf-8") if file.is_a?(String)
|
66
|
+
|
67
|
+
fh.puts self.graph_start
|
68
|
+
fh.puts self.graph_attr
|
69
|
+
fh.puts self.node_attr
|
70
|
+
fh.puts self.edge_attr
|
71
|
+
|
72
|
+
@nodes.each {|n,node| fh.puts " " + node.to_s}
|
73
|
+
|
74
|
+
@links.each do |ary|
|
75
|
+
raise "#{ary[0]} not found as a node" unless @nodes[ary[0]] # from
|
76
|
+
raise "#{ary[2]} not found as a node" unless @nodes[ary[2]] # to
|
77
|
+
if %w[Mrecord record].include?(@nodes[ary[0]].shape)
|
78
|
+
ary[1] = @nodes[ary[0]].get_anchor(ary[1])
|
79
|
+
ary[3] = @nodes[ary[2]].get_anchor(ary[3])
|
80
|
+
end
|
81
|
+
@edges << Edge.new(*ary)
|
82
|
+
end
|
83
|
+
|
84
|
+
@edges.each {|e| fh.puts " " + e.to_s}
|
85
|
+
|
86
|
+
fh.puts self.graph_end
|
87
|
+
fh.close
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
class SubGraph
|
92
|
+
attr_accessor :name
|
93
|
+
def graph_start; " subgraph #{self.name} {" end
|
94
|
+
def graph_end; " }" end
|
95
|
+
end
|
96
|
+
end
|
data/lib/rviz/node.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Rviz
|
2
|
+
class Node
|
3
|
+
attr_accessor :name
|
4
|
+
def initialize name, shape = "box", attrs = {}
|
5
|
+
@name = name
|
6
|
+
@attrs = {"shape" => shape}.merge attrs
|
7
|
+
end
|
8
|
+
|
9
|
+
def shape
|
10
|
+
@attrs["shape"]
|
11
|
+
end
|
12
|
+
|
13
|
+
include Rviz::Helper
|
14
|
+
|
15
|
+
# print out as dot source
|
16
|
+
def to_s
|
17
|
+
sprintf '%s [%s]', self.quote(@name), self.attrs_to_s
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/rviz/record.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
module Rviz
|
2
|
+
class Record < Node
|
3
|
+
def initialize name, attrs = {}
|
4
|
+
super name, "record", attrs
|
5
|
+
@label_rows = Array.new
|
6
|
+
@anchors = Hash.new
|
7
|
+
end
|
8
|
+
|
9
|
+
# from row_name returns the id corresponds to the anchor
|
10
|
+
def get_anchor_id row_name
|
11
|
+
@anchors[row_name]
|
12
|
+
end
|
13
|
+
|
14
|
+
# get the anchor name used for edge link
|
15
|
+
def get_anchor row_name
|
16
|
+
"f" + self.get_anchor_id(row_name).to_s
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_row row_name, create_anchor = false, port_pos = 'n'
|
20
|
+
if create_anchor
|
21
|
+
anchor_id = @anchors.keys.size + 1
|
22
|
+
@anchors[row_name] = anchor_id
|
23
|
+
row_name.gsub!(/([\/\|\\\<\>])/, '-') # escape special characters
|
24
|
+
row_name = "<f#{anchor_id.to_s}>" + row_name
|
25
|
+
end
|
26
|
+
if port_pos
|
27
|
+
raise "unknown port_pos, should in l, r or n" unless %w[l r n].include? port_pos
|
28
|
+
end
|
29
|
+
@label_rows << [row_name, port_pos]
|
30
|
+
self
|
31
|
+
end
|
32
|
+
|
33
|
+
def label_with_rows
|
34
|
+
labels = Array.new
|
35
|
+
i =0
|
36
|
+
@label_rows.each do |a|
|
37
|
+
str, lr = a[0], a[1]
|
38
|
+
str += " \\" + lr if %w[l r].include? lr
|
39
|
+
labels << str
|
40
|
+
end
|
41
|
+
labels.join('|')
|
42
|
+
end
|
43
|
+
|
44
|
+
def to_s
|
45
|
+
@attrs['label'] = self.label_with_rows
|
46
|
+
super
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# a convenient way to inherit Record functions
|
51
|
+
class Mrecord < Record
|
52
|
+
def initialize name, attrs = {}
|
53
|
+
super name, attrs
|
54
|
+
@attrs["shape"] = "Mrecord"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/rviz/version.rb
ADDED
data/lib/rviz.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Rviz
|
2
|
+
module Helper
|
3
|
+
# convert attr hash to a string in dot format
|
4
|
+
def attrs_to_s
|
5
|
+
attr_strs = Array.new
|
6
|
+
|
7
|
+
@attrs.each do |k,v|
|
8
|
+
k = self.quote(k)
|
9
|
+
v = self.quote(v)
|
10
|
+
attr_strs << sprintf('%s=%s', k, v)
|
11
|
+
end
|
12
|
+
attr_strs.join(", ")
|
13
|
+
end
|
14
|
+
|
15
|
+
def set key, value
|
16
|
+
@attrs[key] = value
|
17
|
+
end
|
18
|
+
|
19
|
+
def quote str
|
20
|
+
if str.match(/\W/)
|
21
|
+
%Q{"#{str.to_s}"}
|
22
|
+
else
|
23
|
+
str.to_s
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
require "rviz/edge.rb"
|
30
|
+
require "rviz/graph.rb"
|
31
|
+
require "rviz/node.rb"
|
32
|
+
require "rviz/record.rb"
|
data/rviz.gemspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
2
|
+
require 'rviz/version'
|
3
|
+
|
4
|
+
Gem::Specification.new 'rviz', Rviz::VERSION do |s|
|
5
|
+
s.description = "Rviz is an other ruby interface to graphviz."
|
6
|
+
s.summary = "Graphviz ruby interface"
|
7
|
+
s.authors = ["Huang Wei"]
|
8
|
+
s.email = "huangw@pe-po.com"
|
9
|
+
s.homepage = "https://github.com/huangw/rviz-gem"
|
10
|
+
s.files = `git ls-files`.split("\n") - %w[.gitignore]
|
11
|
+
s.test_files = Dir.glob("{spec,test}/**/*.rb")
|
12
|
+
s.rdoc_options = %w[--line-numbers --inline-source --title Rviz --main README.rdoc --encoding=UTF-8]
|
13
|
+
|
14
|
+
s.add_development_dependency 'rspec', '~> 2.5'
|
15
|
+
end
|
16
|
+
|
data/spec/edge_spec.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Rviz::Edge do
|
4
|
+
describe "#to_s" do
|
5
|
+
it "should format a plain link" do
|
6
|
+
Rviz::Edge.new("A", "", "B").to_s.should eq "A -> B"
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should format link with from anchor" do
|
10
|
+
Rviz::Edge.new("A", "a", "B").to_s.should eq "A:a -> B"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should format link with to anchor" do
|
14
|
+
Rviz::Edge.new("A", "", "B", "b").to_s.should eq "A -> B:b"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should format link with both anchor" do
|
18
|
+
Rviz::Edge.new("A", "a", "B", "b").to_s.should eq "A:a -> B:b"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should format link with special from node" do
|
22
|
+
Rviz::Edge.new("A C", "a", "B", "b").to_s.should eq %q|"A C":a -> B:b|
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should format link with special nodes" do
|
26
|
+
Rviz::Edge.new("A C", "a", "B D", "b").to_s.should eq %q|"A C":a -> "B D":b|
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should format link with label attributes" do
|
30
|
+
Rviz::Edge.new("A B C", "a", "B", "", {label: "Send to me"}).to_s.should eq %q{"A B C":a -> B [label="Send to me"]}
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should format link with more attributes" do
|
34
|
+
Rviz::Edge.new("A B C", "a", "B", "", {label: "Send to me", color: "black"}).to_s.should eq %q{"A B C":a -> B [label="Send to me", color=black]}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
data/spec/graph_spec.rb
ADDED
data/spec/node_spec.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Rviz::Node do
|
4
|
+
describe "#to_s" do
|
5
|
+
it "should return a node in plain format" do
|
6
|
+
Rviz::Node.new("glue").to_s.should eq %Q{glue [shape=box]}
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should return a note with specific shape and attribute" do
|
10
|
+
Rviz::Node.new("glue", "note", {color: "red"}).to_s.should eq %Q{glue [shape=note, color=red]}
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe Rviz::Record do
|
16
|
+
describe "#to_s" do
|
17
|
+
it "should return a record node in plain format" do
|
18
|
+
ar = Rviz::Record.new('a_record')
|
19
|
+
ar.add_row("A Row")
|
20
|
+
ar.add_row("B Row")
|
21
|
+
ar.to_s.should eq %Q{a_record [shape=record, label="A Row|B Row"]}
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should return a record node with an anchor" do
|
25
|
+
ar = Rviz::Record.new('a_record')
|
26
|
+
ar.add_row("A Row", true)
|
27
|
+
ar.add_row("B Row")
|
28
|
+
ar.to_s.should eq %Q{a_record [shape=record, label="<f1>A Row|B Row"]}
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should return a record node with more anchors" do
|
32
|
+
ar = Rviz::Record.new('a_record')
|
33
|
+
ar.add_row("A Row", true)
|
34
|
+
ar.add_row("B Row", true)
|
35
|
+
ar.add_row("C Row", true)
|
36
|
+
ar.to_s.should eq %Q{a_record [shape=record, label="<f1>A Row|<f2>B Row|<f3>C Row"]}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "#get_anchor" do
|
41
|
+
it "should labeled some row with proper id" do
|
42
|
+
ar = Rviz::Record.new('a_record')
|
43
|
+
ar.add_row("A Row", true)
|
44
|
+
ar.add_row("B Row", true)
|
45
|
+
ar.add_row("C Row", true)
|
46
|
+
ar.get_anchor_id("C Row").should eq(3)
|
47
|
+
ar.get_anchor("B Row").should eq("f2")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe Rviz::Mrecord do
|
53
|
+
describe "#to_s" do
|
54
|
+
it "should have a shape of Mrecord" do
|
55
|
+
Rviz::Mrecord.new('m_record').shape.should eq "Mrecord"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Rviz do
|
4
|
+
describe "#attrs_to_s" do
|
5
|
+
it "return attribute set in format" do
|
6
|
+
# mock up
|
7
|
+
m = Rviz::Edge.new "from", "", "to", ""
|
8
|
+
m.set("label", "full stack")
|
9
|
+
m.attrs_to_s.should eq(%q{label="full stack"})
|
10
|
+
end
|
11
|
+
|
12
|
+
it "return initial attributes in format" do
|
13
|
+
m = Rviz::Edge.new "from", "", "to", "", {arrowhead: "onormal"}
|
14
|
+
m.set("label", "full stack")
|
15
|
+
m.attrs_to_s.should eq(%q{arrowhead=onormal, label="full stack"})
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
data/spec/spec_helper.rb
ADDED
data/tags
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
|
2
|
+
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
|
3
|
+
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
|
4
|
+
!_TAG_PROGRAM_NAME Exuberant Ctags //
|
5
|
+
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
|
6
|
+
!_TAG_PROGRAM_VERSION 5.8 //
|
7
|
+
Edge lib/rviz/edge.rb /^ class Edge$/;" c class:Rviz
|
8
|
+
Graph lib/rviz/graph.rb /^ class Graph$/;" c class:Rviz
|
9
|
+
Helper lib/rviz.rb /^ module Helper$/;" m class:Rviz
|
10
|
+
Mrecord lib/rviz/record.rb /^ class Mrecord < Record$/;" c class:Rviz
|
11
|
+
Node lib/rviz/node.rb /^ class Node$/;" c class:Rviz
|
12
|
+
Record lib/rviz/record.rb /^ class Record < Node$/;" c class:Rviz
|
13
|
+
Rviz lib/rviz.rb /^module Rviz$/;" m
|
14
|
+
Rviz lib/rviz/edge.rb /^module Rviz$/;" m
|
15
|
+
Rviz lib/rviz/graph.rb /^module Rviz$/;" m
|
16
|
+
Rviz lib/rviz/node.rb /^module Rviz$/;" m
|
17
|
+
Rviz lib/rviz/record.rb /^module Rviz$/;" m
|
18
|
+
Rviz lib/rviz/version.rb /^module Rviz$/;" m
|
19
|
+
SubGraph lib/rviz/graph.rb /^ class SubGraph$/;" c class:Rviz
|
20
|
+
add_row lib/rviz/record.rb /^ def add_row row_name, create_anchor = false, port_pos = 'n'$/;" f class:Rviz.Record
|
21
|
+
attrs_to_s lib/rviz.rb /^ def attrs_to_s$/;" f class:Rviz.Helper
|
22
|
+
get_anchor_id lib/rviz/record.rb /^ def get_anchor_id row_name$/;" f class:Rviz.Record
|
23
|
+
initialize lib/rviz/edge.rb /^ def initialize from_node, from_anchor, to_node, to_anchor = nil, attributes = {}$/;" f class:Rviz.Edge
|
24
|
+
initialize lib/rviz/node.rb /^ def initialize name, shape = "box", attrs = {}$/;" f class:Rviz.Node
|
25
|
+
initialize lib/rviz/record.rb /^ def initialize name, attrs = {}$/;" f class:Rviz.Mrecord
|
26
|
+
initialize lib/rviz/record.rb /^ def initialize name, attrs = {}$/;" f class:Rviz.Record
|
27
|
+
label_with_rows lib/rviz/record.rb /^ def label_with_rows$/;" f class:Rviz.Record
|
28
|
+
node_anchor lib/rviz/edge.rb /^ def node_anchor node, anchor$/;" f class:Rviz.Edge
|
29
|
+
quote lib/rviz.rb /^ def quote str$/;" f class:Rviz.Helper
|
30
|
+
set lib/rviz.rb /^ def set key, value$/;" f class:Rviz.Helper
|
31
|
+
to_s lib/rviz/edge.rb /^ def to_s$/;" f class:Rviz.Edge
|
32
|
+
to_s lib/rviz/node.rb /^ def to_s$/;" f class:Rviz.Node
|
33
|
+
to_s lib/rviz/record.rb /^ def to_s$/;" f class:Rviz.Record
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rviz
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Huang Wei
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.5'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.5'
|
30
|
+
description: Rviz is an other ruby interface to graphviz.
|
31
|
+
email: huangw@pe-po.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- README.rdoc
|
37
|
+
- Rakefile
|
38
|
+
- examples/hello.png
|
39
|
+
- examples/hello.rb
|
40
|
+
- examples/record.png
|
41
|
+
- examples/record.rb
|
42
|
+
- lib/rviz.rb
|
43
|
+
- lib/rviz/edge.rb
|
44
|
+
- lib/rviz/graph.rb
|
45
|
+
- lib/rviz/node.rb
|
46
|
+
- lib/rviz/record.rb
|
47
|
+
- lib/rviz/version.rb
|
48
|
+
- rviz.gemspec
|
49
|
+
- spec/edge_spec.rb
|
50
|
+
- spec/graph_spec.rb
|
51
|
+
- spec/node_spec.rb
|
52
|
+
- spec/rviz_helper_spec.rb
|
53
|
+
- spec/spec_helper.rb
|
54
|
+
- tags
|
55
|
+
homepage: https://github.com/huangw/rviz-gem
|
56
|
+
licenses: []
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options:
|
59
|
+
- --line-numbers
|
60
|
+
- --inline-source
|
61
|
+
- --title
|
62
|
+
- Rviz
|
63
|
+
- --main
|
64
|
+
- README.rdoc
|
65
|
+
- --encoding=UTF-8
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.8.25
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Graphviz ruby interface
|
86
|
+
test_files:
|
87
|
+
- spec/edge_spec.rb
|
88
|
+
- spec/graph_spec.rb
|
89
|
+
- spec/node_spec.rb
|
90
|
+
- spec/rviz_helper_spec.rb
|
91
|
+
- spec/spec_helper.rb
|