Skip to content

Commit

Permalink
pick your own version
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Nov 30, 2011
1 parent 566c999 commit 7c204f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 4 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ Just add gem 'neography' to your Gemfile and run bundle install.

The following tasks will be available to you:

rake neo4j:install # Install Neo4j to the neo4j directory under your project
rake neo4j:install # Install Neo4j to the neo4j directory under your project
rake neo4j:install[community,1.6.M01] # Install Neo4j Community edition, version 1.6.M01
rake neo4j:install[advanced,1.5] # Install Neo4j Advanced edition, version 1.5
rake neo4j:install[enterprise,1.5] # Install Neo4j Enterprise edition, version 1.5
rake neo4j:start # Start Neo4j
rake neo4j:stop # Stop Neo4j
rake neo4j:restart # Restart Neo4j
Expand Down
17 changes: 9 additions & 8 deletions lib/neography/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

namespace :neo4j do
desc "Install Neo4j"
task :install do
puts 'Installing Neo4j...'
task :install, :edition, :version do |t, args|
args.with_defaults(:edition => "community", :version => "1.6.M01")
puts "Installing Neo4j-#{args[:edition]}-#{args[:version]}"

if OS::Underlying.windows?
# Download Neo4j
unless File.exist?('neo4j.zip')
df = File.open('neo4j.zip', 'wb')
begin
df << HTTParty.get("http://dist.neo4j.org/neo4j-community-1.5-windows.zip")
df << HTTParty.get("http://dist.neo4j.org/neo4j-#{args[:edition]}-#{args[:version]}-windows.zip")
ensure
df.close()
end
Expand All @@ -30,7 +31,7 @@
end
end
end
FileUtils.mv "neo4j-community-1.5", "neo4j"
FileUtils.mv "neo4j-#{args[:edition]}-#{args[:version]}", "neo4j"
end

# Install if running with Admin Privileges
Expand All @@ -40,10 +41,10 @@
end

else
%x[wget http://dist.neo4j.org/neo4j-community-1.5-unix.tar.gz]
%x[tar -xvzf neo4j-community-1.5-unix.tar.gz]
%x[mv neo4j-community-1.5 neo4j]
%x[rm neo4j-community-1.5-unix.tar.gz]
%x[wget http://dist.neo4j.org/neo4j-#{args[:edition]}-#{args[:version]}-unix.tar.gz]
%x[tar -xvzf neo4j-#{args[:edition]}-#{args[:version]}-unix.tar.gz]
%x[mv neo4j-#{args[:edition]}-#{args[:version]} neo4j]
%x[rm neo4j-#{args[:edition]}-#{args[:version]}-unix.tar.gz]
puts "Neo4j Installed in to neo4j directory."
end
puts "Type 'rake neo4j:start' to start it"
Expand Down

0 comments on commit 7c204f0

Please sign in to comment.