Rakefile in mongodoc-0.1.2 vs Rakefile in mongodoc-0.2.0
- old
+ new
@@ -8,13 +8,13 @@
gem.summary = %Q{ODM for MongoDB}
gem.description = %Q{ODM for MongoDB}
gem.email = "leshill@gmail.com"
gem.homepage = "http://github.com/leshill/mongodoc"
gem.authors = ["Les Hill"]
- gem.add_dependency "mongo", "= 0.18.1"
- gem.add_dependency "mongo_ext", "= 0.18.1"
- gem.add_dependency "durran-validatable", "= 1.8.3"
+ gem.add_dependency "mongo", "= 0.18.2"
+ gem.add_dependency "mongo_ext", "= 0.18.2"
+ gem.add_dependency "durran-validatable", "= 1.8.4"
gem.add_dependency "leshill-will_paginate", "= 2.3.11"
gem.add_development_dependency "rspec", "= 1.2.9"
gem.add_development_dependency "cucumber", "= 0.4.4"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
@@ -76,7 +76,39 @@
{}
end
config = default_config.merge(config)
sh("nohup #{config['mongod'] || 'mongod'} --dbpath #{config['dbpath']} &")
puts "\n"
+ end
+end
+
+namespace :bench do
+ desc 'Run benchmark for MongoDoc'
+ task 'mongodoc' do
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
+ require 'perf/mongodoc_runner'
+ MongoDocRunner.benchmark
+ end
+
+ desc 'Run profiler for driver'
+ task 'driver' do
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
+ require 'perf/ruby_driver_runner'
+ RubyDriverRunner.benchmark
+ end
+end
+
+namespace :prof do
+ desc 'Run profiler for MongoDoc'
+ task 'mongodoc' do
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
+ require 'perf/mongodoc_runner'
+ MongoDocRunner.profile
+ end
+
+ desc 'Run profiler for driver'
+ task 'driver' do
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
+ require 'perf/ruby_driver_runner'
+ RubyDriverRunner.profile
end
end