graphviz 1.1.0 → 1.2.0
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 +4 -4
- data/lib/graphviz/graph.rb +2 -2
- data/lib/graphviz/version.rb +1 -1
- metadata +36 -39
- data/.gitignore +0 -17
- data/.rspec +0 -3
- data/.travis.yml +0 -13
- data/Gemfile +0 -13
- data/Guardfile +0 -12
- data/README.md +0 -72
- data/Rakefile +0 -6
- data/examples/demo.rb +0 -37
- data/graphviz.gemspec +0 -29
- data/spec/graphviz/edge_spec.rb +0 -15
- data/spec/graphviz/graph_spec.rb +0 -73
- data/spec/spec_helper.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e82beddf000e7e1bfd1fd5e9a3eeb026e02fdba7aceda468b5ec12c26e474bbf
|
4
|
+
data.tar.gz: c7da9110ff71e4b9ffb02370e9a280baf43edeba0e7aa45bb61e66343a0e70ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5849efcc73015c689cfe3ac51b0e6df16900688b2b843e94a23f9fd9cf064f5d58512aa46e66c77b023958145bf360287819f7ced932c3c7c6ce00e7e46ccda5
|
7
|
+
data.tar.gz: de31e3956f41ab68056af940fcfb032c7669caa59e8eaaf61f003cc3e1f5fd2d29e5bbcfa18201629f17ceacef2c0c890a4890f8b907c35dc0cfd581bd1afa6f
|
data/lib/graphviz/graph.rb
CHANGED
@@ -46,7 +46,7 @@ module Graphviz
|
|
46
46
|
def add_node(name = nil, **attributes)
|
47
47
|
name ||= "#{@name}N#{@nodes.count}"
|
48
48
|
|
49
|
-
Node.new(name, self, attributes)
|
49
|
+
Node.new(name, self, **attributes)
|
50
50
|
end
|
51
51
|
|
52
52
|
# Add a subgraph with a given name and attributes.
|
@@ -131,7 +131,7 @@ module Graphviz
|
|
131
131
|
node.dump_graph(buffer, indent + "\t", options)
|
132
132
|
end
|
133
133
|
|
134
|
-
dump_edges(buffer, indent + "\t", options)
|
134
|
+
dump_edges(buffer, indent + "\t", **options)
|
135
135
|
|
136
136
|
buffer.puts "#{indent}}"
|
137
137
|
end
|
data/lib/graphviz/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: process-pipeline
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bake-bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,35 +39,35 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bake-modernize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: covered
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -80,36 +80,37 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
|
84
|
-
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.6'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.6'
|
97
|
+
description:
|
85
98
|
email:
|
86
|
-
- samuel.williams@oriontransfer.co.nz
|
87
99
|
executables: []
|
88
100
|
extensions: []
|
89
101
|
extra_rdoc_files: []
|
90
102
|
files:
|
91
|
-
- ".gitignore"
|
92
|
-
- ".rspec"
|
93
|
-
- ".travis.yml"
|
94
|
-
- Gemfile
|
95
|
-
- Guardfile
|
96
|
-
- README.md
|
97
|
-
- Rakefile
|
98
|
-
- examples/demo.rb
|
99
|
-
- graphviz.gemspec
|
100
103
|
- lib/graphviz.rb
|
101
104
|
- lib/graphviz/edge.rb
|
102
105
|
- lib/graphviz/graph.rb
|
103
106
|
- lib/graphviz/node.rb
|
104
107
|
- lib/graphviz/version.rb
|
105
|
-
- spec/graphviz/edge_spec.rb
|
106
|
-
- spec/graphviz/graph_spec.rb
|
107
|
-
- spec/spec_helper.rb
|
108
108
|
homepage: https://github.com/ioquatix/graphviz
|
109
109
|
licenses:
|
110
110
|
- MIT
|
111
|
-
metadata:
|
112
|
-
|
111
|
+
metadata:
|
112
|
+
funding_uri: https://github.com/sponsors/ioquatix/
|
113
|
+
post_install_message:
|
113
114
|
rdoc_options: []
|
114
115
|
require_paths:
|
115
116
|
- lib
|
@@ -124,12 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
125
|
- !ruby/object:Gem::Version
|
125
126
|
version: '0'
|
126
127
|
requirements: []
|
127
|
-
|
128
|
-
|
129
|
-
signing_key:
|
128
|
+
rubygems_version: 3.1.2
|
129
|
+
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: A lightweight interface for generating graphs with Graphviz.
|
132
|
-
test_files:
|
133
|
-
- spec/graphviz/edge_spec.rb
|
134
|
-
- spec/graphviz/graph_spec.rb
|
135
|
-
- spec/spec_helper.rb
|
132
|
+
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Guardfile
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
directories %w(lib spec)
|
4
|
-
clearing :on
|
5
|
-
|
6
|
-
ENV['COVERAGE'] = 'y'
|
7
|
-
|
8
|
-
guard :rspec, cmd: "bundle exec rspec" do
|
9
|
-
watch(%r{^spec/.+_spec\.rb$})
|
10
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
-
watch("spec/spec_helper.rb") { "spec" }
|
12
|
-
end
|
data/README.md
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
# Graphviz
|
2
|
-
|
3
|
-
Graphviz is a graph visualisation system. This gem is a lightweight interface for generating graphs with Graphviz.
|
4
|
-
|
5
|
-
[](https://travis-ci.org/ioquatix/graphviz)
|
6
|
-
[](https://coveralls.io/r/ioquatix/graphviz)
|
7
|
-
|
8
|
-
## Installation
|
9
|
-
|
10
|
-
Add this line to your application's Gemfile:
|
11
|
-
|
12
|
-
gem 'graphviz'
|
13
|
-
|
14
|
-
And then execute:
|
15
|
-
|
16
|
-
$ bundle
|
17
|
-
|
18
|
-
Or install it yourself as:
|
19
|
-
|
20
|
-
$ gem install graphviz
|
21
|
-
|
22
|
-
## Usage
|
23
|
-
|
24
|
-
Some example code:
|
25
|
-
|
26
|
-
require 'graphviz';
|
27
|
-
|
28
|
-
g = Graphviz::Graph.new
|
29
|
-
|
30
|
-
foo = g.add_node("Foo")
|
31
|
-
foo.add_node("Bar")
|
32
|
-
|
33
|
-
foo.attributes[:shape] = 'box3d'
|
34
|
-
foo.attributes[:color] = 'red'
|
35
|
-
|
36
|
-
# Dup the dot data:
|
37
|
-
puts g.to_dot
|
38
|
-
|
39
|
-
# Process the graph to output:
|
40
|
-
Graphviz::output(g, :path => "test.pdf")
|
41
|
-
|
42
|
-
## Contributing
|
43
|
-
|
44
|
-
1. Fork it
|
45
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
46
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
47
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
48
|
-
5. Create new Pull Request
|
49
|
-
|
50
|
-
## License
|
51
|
-
|
52
|
-
Released under the MIT license.
|
53
|
-
|
54
|
-
Copyright, 2013, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
55
|
-
|
56
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
57
|
-
of this software and associated documentation files (the "Software"), to deal
|
58
|
-
in the Software without restriction, including without limitation the rights
|
59
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
60
|
-
copies of the Software, and to permit persons to whom the Software is
|
61
|
-
furnished to do so, subject to the following conditions:
|
62
|
-
|
63
|
-
The above copyright notice and this permission notice shall be included in
|
64
|
-
all copies or substantial portions of the Software.
|
65
|
-
|
66
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
67
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
68
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
69
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
70
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
71
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
72
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
data/examples/demo.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require_relative '../lib/graphviz'
|
4
|
-
|
5
|
-
# Hello
|
6
|
-
# |
|
7
|
-
# People
|
8
|
-
|
9
|
-
hello = Graphviz::Graph.new("Hello")
|
10
|
-
keywords = []
|
11
|
-
keywords[0] = hello.add_node("Hello")
|
12
|
-
keywords[1] = hello.add_node("People")
|
13
|
-
|
14
|
-
# We link Hello to People
|
15
|
-
hello_people = keywords[0].connect(keywords[1])
|
16
|
-
|
17
|
-
# People
|
18
|
-
# / | \
|
19
|
-
# Bob Jim Kev
|
20
|
-
|
21
|
-
people = Graphviz::Graph.new("People")
|
22
|
-
persons = []
|
23
|
-
persons[0] = people.add_node("Bob")
|
24
|
-
persons[1] = people.add_node("Jim")
|
25
|
-
persons[2] = people.add_node("Kev")
|
26
|
-
|
27
|
-
# We link people (People = {Bob, Jim, Kev})
|
28
|
-
people_bob = keywords[1].connect(persons[0])
|
29
|
-
people_jim = keywords[1].connect(persons[1])
|
30
|
-
people_kev = keywords[1].connect(persons[2])
|
31
|
-
|
32
|
-
# Attributes for "Hello"
|
33
|
-
keywords[0].attributes[:shape] = 'box3d'
|
34
|
-
keywords[0].attributes[:color] = 'red'
|
35
|
-
|
36
|
-
# Generate the Graph (pdf format)
|
37
|
-
Graphviz::output(hello, :path => "test.pdf")
|
data/graphviz.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative 'lib/graphviz/version'
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = "graphviz"
|
6
|
-
spec.version = Graphviz::VERSION
|
7
|
-
spec.authors = ["Samuel Williams"]
|
8
|
-
spec.email = ["samuel.williams@oriontransfer.co.nz"]
|
9
|
-
spec.description = <<-EOF
|
10
|
-
Graphviz is a graph visualisation system. This gem is a lightweight interface for generating graphs with Graphviz.
|
11
|
-
EOF
|
12
|
-
spec.summary = "A lightweight interface for generating graphs with Graphviz."
|
13
|
-
spec.homepage = "https://github.com/ioquatix/graphviz"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.has_rdoc = 'yard'
|
22
|
-
|
23
|
-
spec.add_dependency 'process-pipeline'
|
24
|
-
|
25
|
-
spec.add_development_dependency "yard"
|
26
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
27
|
-
spec.add_development_dependency "rspec", "~> 3.6"
|
28
|
-
spec.add_development_dependency "rake"
|
29
|
-
end
|
data/spec/graphviz/edge_spec.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
|
2
|
-
RSpec.describe Graphviz::Edge do
|
3
|
-
let(:graph) {Graphviz::Graph.new}
|
4
|
-
|
5
|
-
let(:a) {Graphviz::Node.new(:a, graph)}
|
6
|
-
let(:b) {Graphviz::Node.new(:b, graph)}
|
7
|
-
|
8
|
-
describe '#to_s' do
|
9
|
-
subject{a.connect(b)}
|
10
|
-
|
11
|
-
it 'should generate edge string' do
|
12
|
-
expect(subject.to_s).to be == 'a -> b'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/spec/graphviz/graph_spec.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
# Copyright, 2014, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
11
|
-
# all copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
# THE SOFTWARE.
|
20
|
-
|
21
|
-
require 'graphviz'
|
22
|
-
|
23
|
-
RSpec.describe Graphviz::Graph do
|
24
|
-
let(:sample_graph_dot) do
|
25
|
-
<<~EOF
|
26
|
-
digraph "G" {
|
27
|
-
"Foo"[shape="box3d", color="red"];
|
28
|
-
"Bar";
|
29
|
-
"Foo" -> "Bar";
|
30
|
-
}
|
31
|
-
EOF
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should construct a simple graph" do
|
35
|
-
foo = subject.add_node("Foo")
|
36
|
-
foo.add_node("Bar")
|
37
|
-
|
38
|
-
foo.attributes[:shape] = 'box3d'
|
39
|
-
foo.attributes[:color] = 'red'
|
40
|
-
|
41
|
-
expect(subject.to_dot).to be == sample_graph_dot
|
42
|
-
|
43
|
-
# Process the graph to output:
|
44
|
-
Graphviz::output(subject, :path => "test.pdf")
|
45
|
-
|
46
|
-
expect(File.exist? "test.pdf").to be true
|
47
|
-
end
|
48
|
-
|
49
|
-
it "gets a node" do
|
50
|
-
foo = subject.add_node('Foo')
|
51
|
-
bar = subject.add_node('Bar')
|
52
|
-
bar.add_node('Baz')
|
53
|
-
expect(subject.get_node('Baz')).to be_an(Array)
|
54
|
-
expect(subject.get_node('Baz').size).to eq 1
|
55
|
-
expect(subject.get_node('Foo').first).to be_a(Graphviz::Node)
|
56
|
-
expect(subject.get_node('Nothing')).to be_an(Array)
|
57
|
-
expect(subject.get_node('Nothing').size).to eq 0
|
58
|
-
end
|
59
|
-
|
60
|
-
it "checks if a node exists" do
|
61
|
-
foo = subject.add_node('Foo')
|
62
|
-
bar = subject.add_node('Bar')
|
63
|
-
bar.add_node('Baz')
|
64
|
-
expect(subject.node_exists?('Baz')).to be true
|
65
|
-
expect(subject.node_exists?('Nothing')).to be false
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'should raise an error the executable is installed' do
|
69
|
-
expect do
|
70
|
-
Graphviz.output(subject, :dot => 'foobarbaz')
|
71
|
-
end.to raise_error(Errno::ENOENT, 'No such file or directory - foobarbaz')
|
72
|
-
end
|
73
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
|
2
|
-
if ENV['COVERAGE'] || ENV['TRAVIS']
|
3
|
-
begin
|
4
|
-
require 'simplecov'
|
5
|
-
|
6
|
-
SimpleCov.start do
|
7
|
-
add_filter "/spec/"
|
8
|
-
end
|
9
|
-
|
10
|
-
if ENV['TRAVIS']
|
11
|
-
require 'coveralls'
|
12
|
-
Coveralls.wear!
|
13
|
-
end
|
14
|
-
rescue LoadError
|
15
|
-
warn "Could not load simplecov: #{$!}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
require "bundler/setup"
|
20
|
-
require "graphviz"
|
21
|
-
|
22
|
-
Thread.abort_on_exception = true
|
23
|
-
|
24
|
-
RSpec.configure do |config|
|
25
|
-
# Enable flags like --only-failures and --next-failure
|
26
|
-
config.example_status_persistence_file_path = ".rspec_status"
|
27
|
-
|
28
|
-
config.expect_with :rspec do |c|
|
29
|
-
c.syntax = :expect
|
30
|
-
end
|
31
|
-
end
|