Skip to content

Commit

Permalink
adding tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Oct 31, 2011
1 parent b0e9439 commit 764a146
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -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>
7 changes: 6 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 20 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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://',
Expand Down
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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


50 changes: 50 additions & 0 deletions lib/neography/tasks.rb
Original file line number Diff line number Diff line change
@@ -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.