graphable 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "graphable"
15
15
  gem.require_paths = ["lib"]
16
16
 
17
- gem.add_dependency "active_support"
17
+ gem.add_dependency "activesupport", '~> 3.1'
18
18
  gem.add_dependency "neography"
19
19
 
20
20
  gem.version = Graphable::VERSION
@@ -1,3 +1,3 @@
1
1
  module Graphable
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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-27 00:00:00.000000000 Z
12
+ date: 2012-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: active_support
16
- requirement: &2152759120 !ruby/object:Gem::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: '0'
21
+ version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152759120
24
+ version_requirements: *2156110640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: neography
27
- requirement: &2152758480 !ruby/object:Gem::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: *2152758480
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