graph_builder 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +6 -0
- data/Gemfile +2 -0
- data/README.md +8 -2
- data/Rakefile +7 -0
- data/lib/graph_builder/linkable.rb +3 -0
- data/lib/graph_builder/version.rb +1 -1
- metadata +3 -2
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# GraphBuilder
|
2
2
|
|
3
|
-
|
3
|
+
[![Build History][2]][1]
|
4
|
+
|
5
|
+
[1]: http://travis-ci.org/tracksun/graph_builder
|
6
|
+
[2]: https://secure.travis-ci.org/tracksun/graph_builder.png?branch=master
|
7
|
+
|
8
|
+
|
9
|
+
DSL to build directed graphs
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -84,7 +90,7 @@ graph_builder comes with the module GraphBuilder::Linkable which implements
|
|
84
90
|
link_to( other )
|
85
91
|
|
86
92
|
# returns an array of objects self is linked to
|
87
|
-
|
93
|
+
linked_to
|
88
94
|
|
89
95
|
# returns an array of pairs [ [ self, other1 ], [ self, other2 ], ... ]
|
90
96
|
# for linked objects other1, other2, ...
|
data/Rakefile
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
module GraphBuilder
|
2
2
|
module Linkable
|
3
3
|
|
4
|
+
# links other to self
|
4
5
|
def link_to other
|
5
6
|
linked_to << other
|
6
7
|
end
|
7
8
|
|
9
|
+
# returns array of objects to which self is linked
|
8
10
|
def linked_to
|
9
11
|
@linked_to ||= []
|
10
12
|
end
|
11
13
|
|
14
|
+
# returns array of [ self, object ] where each object linked to self
|
12
15
|
def links
|
13
16
|
linked_to.map{|to|[self,to]}
|
14
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graph_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-11 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: DSL for building directed graphs
|
15
15
|
email:
|
@@ -19,6 +19,7 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- .gitignore
|
22
|
+
- .travis.yml
|
22
23
|
- Gemfile
|
23
24
|
- LICENSE
|
24
25
|
- README.md
|