gv 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -3
- data/gv.gemspec +1 -1
- data/lib/gv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ab9a6ec4d306435db96592402c93d4e2746815d
|
4
|
+
data.tar.gz: 141d01be0f201f81285c758d217df94d0d34d17e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d1128773dee3e2b1d7a7ea29d1201247cb74ed8bc65e2f75cfbe2eedc00939aa4becd1041061718e171fa0b693689fb7ae331e0d7b5eee83471b8bdca83f8c8
|
7
|
+
data.tar.gz: d891316e6792c0be6f6821f81c6b1d3e05bc63fca2b5e897641efb7087ed17af5cb94e326d2f593f8d75826024b3bd3131d3f90d0abe3e9d93c5e2402f2955be
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# GV
|
2
2
|
|
3
|
-
|
3
|
+
Ruby bindings for libgvc (Graphviz) using FFI.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,11 +20,36 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
### Create new graph:
|
24
|
+
```ruby
|
25
|
+
require 'gv'
|
26
|
+
|
27
|
+
graph = GV::Graph.open 'g'
|
28
|
+
graph.edge 'e', graph.node('A'), graph.node('B', shape: 'polygon')
|
29
|
+
|
30
|
+
# render to string
|
31
|
+
graph.render 'png'
|
32
|
+
|
33
|
+
# or to a file
|
34
|
+
graph.write 'result.png'
|
35
|
+
```
|
36
|
+
|
37
|
+
#### Result
|
38
|
+
![resilt](/spec/render.png)
|
39
|
+
|
40
|
+
### Load existing graph from `.dot` file:
|
41
|
+
```ruby
|
42
|
+
require 'gv'
|
43
|
+
|
44
|
+
graph = GV::Graph.load File.open('g.dot')
|
45
|
+
|
46
|
+
# render graph
|
47
|
+
graph.render
|
48
|
+
```
|
24
49
|
|
25
50
|
## Contributing
|
26
51
|
|
27
|
-
1. Fork it ( https://github.com/
|
52
|
+
1. Fork it ( https://github.com/furunkel/gv/fork )
|
28
53
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
54
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
55
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/gv.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = GV::VERSION
|
9
9
|
spec.authors = ["furunkel"]
|
10
10
|
spec.email = ["julian@linux4you.it"]
|
11
|
-
spec.summary = %q{Graphviz for Ruby, using libgvc
|
11
|
+
spec.summary = %q{Graphviz for Ruby, using libgvc via FFI}
|
12
12
|
spec.homepage = "https://github.com/furunkel/gv"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
data/lib/gv/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- furunkel
|
@@ -108,7 +108,7 @@ rubyforge_project:
|
|
108
108
|
rubygems_version: 2.4.5
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
|
-
summary: Graphviz for Ruby, using libgvc
|
111
|
+
summary: Graphviz for Ruby, using libgvc via FFI
|
112
112
|
test_files:
|
113
113
|
- spec/graph_spec.rb
|
114
114
|
- spec/render.png
|