Skip to content

Instantly share code, notes, and snippets.

@grantmichaels
Created April 3, 2010 14:30
Show Gist options
  • Save grantmichaels/354524 to your computer and use it in GitHub Desktop.
Save grantmichaels/354524 to your computer and use it in GitHub Desktop.
let's get Neo4j setup ...
jruby -r java -e "puts java.lang.System.get_property('java.class.path')"
jruby -S jirb
> require 'rubygems' # don't seem to need to require 'lucene' anymore
> require 'neo4j/auto_tx' # 'neo4j' req's a transaction wrapping like
=> #<Neo4j::Node:0x457414c8 @internal_node=#<#<Class:01x48007a17>:0x174fa0ef>>
--- paste into a file ---
require 'rubygems'
require 'sinatra'
require 'lucene'
require 'neo4j/auto_tx'
node1 = Neo4j::Node.new
node2 = Neo4j::Node.new
node1[:name] = 'grant'
node2[:name] = 'tasha'
text = node1[:name]
more_text = node2[:name]
get '/' do
body "#{text} is friends with #{more_text}"
end
YAY!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment