minor: fix for require failing in tests

This commit is contained in:
Tyler Brock 2012-02-06 17:45:41 -05:00
parent 99d9dfddfb
commit 1c765fb338
2 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,8 @@ task :test do
end end
namespace :test do namespace :test do
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
desc "Test the driver with the C extension enabled." desc "Test the driver with the C extension enabled."
task :c do task :c do
ENV['C_EXT'] = 'TRUE' ENV['C_EXT'] = 'TRUE'
@ -124,7 +125,7 @@ namespace :test do
task :drop_databases do |t| task :drop_databases do |t|
puts "Dropping test databases..." puts "Dropping test databases..."
require './lib/mongo' require 'mongo'
con = Mongo::Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost', con = Mongo::Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost',
ENV['MONGO_RUBY_DRIVER_PORT'] || Mongo::Connection::DEFAULT_PORT) ENV['MONGO_RUBY_DRIVER_PORT'] || Mongo::Connection::DEFAULT_PORT)
con.database_names.each do |name| con.database_names.each do |name|
@ -143,8 +144,7 @@ end
desc "Generate YARD documentation" desc "Generate YARD documentation"
task :ydoc do task :ydoc do
$:.unshift(File.join(File.dirname(__FILE__), 'lib')) require 'mongo'
require File.join(File.dirname(__FILE__), 'lib', 'mongo')
out = File.join('ydoc', Mongo::VERSION) out = File.join('ydoc', Mongo::VERSION)
FileUtils.rm_rf('ydoc') FileUtils.rm_rf('ydoc')
system "yardoc lib/**/*.rb lib/mongo/**/*.rb lib/bson/**/*.rb -e ./yard/yard_ext.rb -p yard/templates -o #{out} --title MongoRuby-#{Mongo::VERSION} --files docs/TUTORIAL.md,docs/GridFS.md,docs/FAQ.md,docs/REPLICA_SETS.md,docs/WRITE_CONCERN.md,docs/READ_PREFERENCE.md,docs/HISTORY.md,docs/CREDITS.md,docs/RELEASES.md,docs/CREDITS.md,docs/TAILABLE_CURSORS.md" system "yardoc lib/**/*.rb lib/mongo/**/*.rb lib/bson/**/*.rb -e ./yard/yard_ext.rb -p yard/templates -o #{out} --title MongoRuby-#{Mongo::VERSION} --files docs/TUTORIAL.md,docs/GridFS.md,docs/FAQ.md,docs/REPLICA_SETS.md,docs/WRITE_CONCERN.md,docs/READ_PREFERENCE.md,docs/HISTORY.md,docs/CREDITS.md,docs/RELEASES.md,docs/CREDITS.md,docs/TAILABLE_CURSORS.md"

View File

@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = Mongo::VERSION s.version = Mongo::VERSION
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.summary = 'Ruby driver for the MongoDB' s.summary = 'Ruby driver for MongoDB'
s.description = 'A Ruby driver for MongoDB. For more information about Mongo, see http://www.mongodb.org.' s.description = 'A Ruby driver for MongoDB. For more information about Mongo, see http://www.mongodb.org.'
s.require_paths = ['lib'] s.require_paths = ['lib']