README.md in neoid-0.1.2 vs README.md in neoid-0.2.0

- old
+ new

@@ -1,19 +1,22 @@ # Neoid -[![Build Status](https://secure.travis-ci.org/elado/neoid.png)](http://travis-ci.org/elado/neoid) +[![Gem Version](https://badge.fury.io/rb/neoid.svg)](http://badge.fury.io/rb/neoid) +[![Code Climate](https://codeclimate.com/github/neoid-gem/neoid.png)](https://codeclimate.com/github/neoid-gem/neoid) +[![Build Status](https://secure.travis-ci.org/neoid-gem/neoid.png)](http://travis-ci.org/neoid-gem/neoid) +__This gem is not stable. There are currently no stable versions. We're working on fixing this right now. Apologies.__ -Make your ActiveRecords stored and searchable on Neo4j graph database, in order to make fast graph queries that MySQL would crawl while doing them. +Make your ActiveRecords stored and searchable on Neo4j graph database, in order to make fast graph queries that MySQL would crawl while doing them. Originally by [@elado](http://twitter.com/elado). -Neoid to Neo4j is like Sunspot to Solr. You get the benefits of Neo4j speed while keeping your schema on your plain old RDBMS. +Neoid is to Neo4j as Sunspot is to Solr. You get the benefits of Neo4j's speed while keeping your schema on your RDBMS. -Neoid doesn't require JRuby. It's based on the great [Neography](https://github.com/maxdemarzi/neography) gem which uses Neo4j's REST API. +Neoid does not require JRuby. It's based on the [Neography](https://github.com/maxdemarzi/neography) gem which uses Neo4j's REST API. Neoid offers querying Neo4j for IDs of objects and then fetch them from your RDBMS, or storing all desired data on Neo4j. -**Important: Heroku Support is not available because Herokud doesn't support Gremlin. So until further notice, easiest way is to self host a Neo4j on EC2 in the same zone, and connect from your dyno to it** +__Important: If you are hosting your application on Heroku with Neoid, [GrapheneDB](http://www.graphenedb.com/) does support Gremlin code; their add-on is [located here](https://addons.heroku.com/graphenedb). Also be reminded that the Gremlin code is actively being refactored into Cypher.__ ## Changelog [See Changelog](https://github.com/elado/neoid/blob/master/CHANGELOG.md). Including some breaking changes (and solutions) from previos versions. @@ -21,20 +24,30 @@ ## Installation Add to your Gemfile and run the `bundle` command to install it. ```ruby -gem 'neoid', '~> 0.1.1' +gem 'neoid', '~> 0.2.0' ``` -**Requires Ruby 1.9.2 or later.** +**Requires Ruby 1.9.3 or later and Neo4j 1.9.8.** +### Installing Neo4j 1.9.8 for your project + +We're currently working to bump to 2.1.x land, but for now, you have to use 1.9.8. To get started, install neo4j locally in your project with: + +```bash +gem install neo4j-core --pre +rake neo4j:install[community,1.9.8] +rake neo4j:start +``` + ## Usage ### Rails app configuration: -In an initializer, such as `config/initializers/01_neo4j.rb`: +Initializer neography and neoid in an initializer that is prefixed with `01_`, such as `config/initializers/01_neo4j.rb`: ```ruby ENV["NEO4J_URL"] ||= "http://localhost:7474" uri = URI.parse(ENV["NEO4J_URL"]) @@ -58,15 +71,10 @@ # should Neoid create sub-reference from the ref node (id#0) to every node-model? default: true c.enable_subrefs = true end ``` -`01_` in the file name is in order to get this file loaded first, before the models (initializers are loaded alphabetically). - -If you have a better idea (I bet you do!) please let me know. - - ### ActiveRecord configuration #### Nodes For nodes, first include the `Neoid::Node` module in your model: @@ -155,11 +163,11 @@ c.relationship start_node: :user, end_node: :movie, type: :likes end end ``` -Neoid adds the metohds `neo_node` and `neo_relationships` to instances of nodes and relationships, respectively. +Neoid adds the methods `neo_node` and `neo_relationships` to instances of nodes and relationships, respectively. So you could do: ```ruby user = User.create!(display_name: "elado") @@ -411,11 +419,12 @@ In order to test your app or this gem, you need a running Neo4j database, dedicated to tests. I use port 7574 for testing. -To run another database locally (read [here](http://docs.neo4j.org/chunked/1.9.M03/server-installation.html#_multiple_server_instances_on_one_machine) too): +To run another database locally (read +[here](http://docs.neo4j.org/chunked/stable/ha-setup-tutorial.html#ha-local-cluster) too): Copy the entire Neo4j database folder to a different location, **or** @@ -443,25 +452,18 @@ end ``` ## Testing This Gem -Run the Neo4j DB on port 7574, and run `rake` from the gem folder. +Run the Neo4j DB on port 7474, and run `rake` from the gem folder. ## Contributing Please create a [new issue](https://github.com/elado/neoid/issues) if you run into any bugs. Contribute patches via pull requests. Write tests and make sure all tests pass. - -## Heroku Support - -Unfortunately, as for now, Neo4j add-on on Heroku doesn't support Gremlin. Therefore, this gem won't work on Heroku's add on. You should self-host a Neo4j instance on an EC2 or any other server. - - ## TO DO -[TO DO](HTTPS://GITHUB.COM/ELADO/NEOID/BLOB/MASTER/TODO.MD) +[TO DO](https://github.com/elado/neoid/blob/master/TODO.md) - --- -Developed by [@elado](http://twitter.com/elado) +Developed by [@elado](http://twitter.com/elado) and [@BenMorganIO](http://twitter.com/BenMorganIO)