Permalink
Browse files

adding tasks

  • Loading branch information...
1 parent b0e9439 commit 764a146e6e5628197a9948409aa284a9f1fd0f66 @maxdemarzi maxdemarzi committed Oct 31, 2011
Showing with 92 additions and 3 deletions.
  1. +12 −0 .project
  2. +6 −1 CONTRIBUTORS
  3. +20 −1 README.rdoc
  4. +4 −1 Rakefile
  5. +50 −0 lib/neography/tasks.rb
View
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>neography</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ <nature>com.aptana.ruby.core.rubynature</nature>
+ </natures>
+</projectDescription>
View
@@ -4,4 +4,9 @@ Maintainer:
Contributors:
* Peter Neubauer
* Ian Dees
-* Phuong CAO
+* Phuong CAO
+* Carlo Alberto Degli Atti
+* Stephen Becker IV
+* Thomas Baum
+* Maximilian Schulz
+* Hesham Amiri
View
@@ -4,7 +4,12 @@ Neography is a thin Ruby wrapper to the Neo4j Rest API, for more information:
* {Getting Started with Neo4j Server}[http://wiki.neo4j.org/content/Getting_Started_with_Neo4j_Server]
* {Neo4j Rest API Reference}[http://components.neo4j.org/neo4j-server/milestone/rest.html]
-If you want to the full power of Neo4j, you will want to use JRuby and the excellent Neo4j.rb gem at https://github.com/andreasronge/neo4j
+If you want to the full power of Neo4j, you will want to use JRuby and the excellent Neo4j.rb gem at https://github.com/andreasronge/neo4j by Andreas Ronge
+
+A complement to Neography is the Neology Gem at https://github.com/lordkada/neology by Carlo Alberto Degli Atti
+
+An alternative is the Architect4r Gem at https://github.com/namxam/architect4r by Maximilian Schulz
+
=== Installation
@@ -37,6 +42,20 @@ in order to access the functionality.
Just add gem 'neography' to your Gemfile and run bundle install
+=== Tasks
+
+In your Rakefile or "lib/tasks/neography.rake", add:
+
+ require 'neography/tasks'
+
+It will add the following rake tasks to your project:
+
+ rake neo4j:install # Install Neo4j to the neo4j directory under your project
+ rake neo4j:start # Start Neo4j
+ rake neo4j:stop # Stop Neo4j
+ rake neo4j:restart # Restart Neo4j
+ rake neo4j:reset_yes_i_am_sure # Wipe your Neo4j Database
+
=== Documentation
@neo = Neography::Rest.new({:protocol => 'http://',
View
@@ -8,4 +8,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = "spec/integration/*_spec.rb"
end
-task :default => :spec
+desc "Run Tests"
+task :default => :spec
+
+
View
@@ -0,0 +1,50 @@
+# borrowed from architect4r
+
+namespace :neo4j do
+ desc "Install Neo4j"
+ task :install do
+ puts 'Installing Neo4j...'
+ %x[wget http://dist.neo4j.org/neo4j-community-1.5.M02-unix.tar.gz]
+ %x[tar -xvzf neo4j-community-1.5.M02-unix.tar.gz]
+ %x[mv neo4j-community-1.5.M02 neo4j]
+ %x[rm neo4j-community-1.5.M02-unix.tar.gz]
+ puts "Neo4j Installed in to neo4j directory."
+ puts "Type 'rake neo4j:start' to start it"
+ end
+
+ desc "Start the Neo4j Server"
+ task :start do
+ puts "Starting Neo4j..."
+ %x[neo4j/bin/neo4j start]
+ end
+
+ desc "Stop the Neo4j Server"
+ task :stop do
+ puts "Stopping Neo4j..."
+ %x[neo4j/bin/neo4j stop]
+ end
+
+ desc "Restart the Neo4j Server"
+ task :restart do
+ puts "Restarting Neo4j..."
+ %x[neo4j/bin/neo4j restart]
+ end
+
+ desc "Reset the Neo4j Server"
+ task :reset_yes_i_am_sure do
+ # Stop the server
+ %x[neo4j/bin/neo4j stop]
+
+ # Reset the database
+ FileUtils.rm_rf("neo4j/data/graph.db")
+ FileUtils.mkdir("neo4j/data/graph.db")
+
+ # Remove log files
+ FileUtils.rm_rf("neo4j/data/log")
+ FileUtils.mkdir("neo4j/data/log")
+
+ # Start the server
+ %x[neo4j/bin/neo4j start]
+ end
+
+end

0 comments on commit 764a146

Please sign in to comment.