This repository has been archived by the owner on Jun 13, 2019. It is now read-only.
forked from shanna/dm-mongo-adapter
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to start mongodb instances for jruby
- Loading branch information
Markus Schirp
committed
Oct 5, 2011
1 parent
d689c2e
commit 2b84bcc
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'fileutils' | ||
|
||
tmpdir = File.expand_path(File.join(File.dirname(__FILE__),'..','tmp')) | ||
dbpath = File.join(tmpdir,'mongodb') | ||
|
||
if File.exists? dbpath | ||
puts "removing dbpath: #{dbpath}" | ||
FileUtils.rm_rf dbpath | ||
end | ||
|
||
unless File.exists? dbpath | ||
puts "creating dbpath: #{dbpath}" | ||
FileUtils.mkdir_p dbpath | ||
end | ||
|
||
command = %W(mongod -dbpath #{dbpath} -noprealloc -nojournal -noauth -port 26016 -bind_ip 127.0.0.1) | ||
|
||
puts "executing: #{command.join(' ')}" | ||
puts '************************************************************' | ||
puts 'Run specs: $ MONGO_URL=mongo://127.0.0.1:26016 bundle exec spec spec' | ||
puts '************************************************************' | ||
Kernel.exec *command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters