graphable 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +44 -0
- data/graphable.gemspec +1 -1
- data/lib/graphable/version.rb +1 -1
- metadata +10 -9
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#Graphable
|
2
|
+
|
3
|
+
Graphable is a ruby gem which builds static graphs in Neo4j from a secondary,
|
4
|
+
ActiveModel-ish data store.
|
5
|
+
|
6
|
+
## How to use it:
|
7
|
+
|
8
|
+
Say you have some models:
|
9
|
+
|
10
|
+
|
11
|
+
#where ActiveMapper::Root is your ActiveModelly ORM of choice
|
12
|
+
class User < ActiveMapper::Root
|
13
|
+
|
14
|
+
has_many :followers, :class => User
|
15
|
+
|
16
|
+
property :name
|
17
|
+
property :join_date
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
And you want to turn it into a graph periodically for cool reporting or
|
22
|
+
something. Then you can do:
|
23
|
+
|
24
|
+
|
25
|
+
class User < ActiveMapper::Root
|
26
|
+
include Graphable
|
27
|
+
|
28
|
+
has_edge to: User, via: :followers, name: "followed_by"
|
29
|
+
has_many :followers, :class => User
|
30
|
+
|
31
|
+
indexes :name, :join_date
|
32
|
+
|
33
|
+
property :name
|
34
|
+
property :join_date
|
35
|
+
end
|
36
|
+
|
37
|
+
Which will take your SQL db and turn it into a lovely Neo4j Graph! (With indexes
|
38
|
+
automatically on the :id field, and anything else you specify in the `indexes`
|
39
|
+
call. Don't worry if you specify something twice, it won't double index!
|
40
|
+
|
41
|
+
## Warning:
|
42
|
+
|
43
|
+
This is _very_ organic, I extracted the concept from another project, rewrote it
|
44
|
+
here in an afternoon, and here it is.
|
data/graphable.gemspec
CHANGED
data/lib/graphable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03
|
12
|
+
date: 2012-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: activesupport
|
16
|
+
requirement: &2156110640 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156110640
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: neography
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156109380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156109380
|
36
36
|
description: A library for extracting static graph representations of data from rails-y
|
37
37
|
databases
|
38
38
|
email:
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- .gitignore
|
45
45
|
- .rvmrc
|
46
46
|
- Gemfile
|
47
|
+
- README.md
|
47
48
|
- Rakefile
|
48
49
|
- graphable.gemspec
|
49
50
|
- lib/graphable.rb
|