Skip to content

Instantly share code, notes, and snippets.

@tjackiw
Created December 18, 2012 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjackiw/4332984 to your computer and use it in GitHub Desktop.
Save tjackiw/4332984 to your computer and use it in GitHub Desktop.
Using a Graph Database with Ruby. Part II: Integration
require('neography') unless defined?(Neography)
ENV["NEO4J_URL"] ||= "http://localhost:7474"
uri = URI.parse(ENV["NEO4J_URL"])
neo = Neography::Rest.new(uri.to_s)
Neography.configure do |c|
c.server = uri.host
c.port = uri.port
if uri.user && uri.password
c.authentication = 'basic'
c.username = uri.user
c.password = uri.password
end
end
Neoid.db = neo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment