2009-11-25 16:43:25 +00:00
|
|
|
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2009-10-26 19:34:45 +00:00
|
|
|
|
2009-12-01 18:49:57 +00:00
|
|
|
module Mongo
|
2010-01-25 19:26:29 +00:00
|
|
|
VERSION = "0.18.3p"
|
2009-12-01 18:49:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
2009-12-01 22:23:24 +00:00
|
|
|
# Need this for running test with and without c ext in Ruby 1.9.
|
|
|
|
raise LoadError if ENV['TEST_MODE'] && !ENV['C_EXT']
|
2009-12-01 18:49:57 +00:00
|
|
|
require 'mongo_ext/cbson'
|
2009-12-02 17:14:07 +00:00
|
|
|
raise LoadError unless defined?(CBson::VERSION) && CBson::VERSION == Mongo::VERSION
|
2009-12-01 18:49:57 +00:00
|
|
|
require 'mongo/util/bson_c'
|
2010-01-05 22:42:52 +00:00
|
|
|
BSON = BSON_C
|
2009-12-01 18:49:57 +00:00
|
|
|
rescue LoadError
|
|
|
|
require 'mongo/util/bson_ruby'
|
2010-01-05 22:42:52 +00:00
|
|
|
BSON = BSON_RUBY
|
2009-12-01 18:49:57 +00:00
|
|
|
warn "\n**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance."
|
|
|
|
warn " You can install the extension as follows:\n gem install mongo_ext\n"
|
|
|
|
warn " If you continue to receive this message after installing, make sure that the"
|
2009-12-02 15:16:03 +00:00
|
|
|
warn " mongo_ext gem is in your load path and that the mongo_ext and mongo gems are of the same version.\n"
|
2009-12-16 19:03:15 +00:00
|
|
|
end
|
2009-12-01 18:49:57 +00:00
|
|
|
|
2010-01-08 20:43:13 +00:00
|
|
|
module Mongo
|
|
|
|
ASCENDING = 1
|
|
|
|
DESCENDING = -1
|
|
|
|
|
|
|
|
module Constants
|
|
|
|
OP_REPLY = 1
|
|
|
|
OP_MSG = 1000
|
|
|
|
OP_UPDATE = 2001
|
|
|
|
OP_INSERT = 2002
|
|
|
|
OP_QUERY = 2004
|
|
|
|
OP_GET_MORE = 2005
|
|
|
|
OP_DELETE = 2006
|
|
|
|
OP_KILL_CURSORS = 2007
|
|
|
|
|
|
|
|
OP_QUERY_SLAVE_OK = 4
|
|
|
|
OP_QUERY_NO_CURSOR_TIMEOUT = 16
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2009-01-13 15:23:20 +00:00
|
|
|
require 'mongo/types/binary'
|
2009-10-22 18:10:12 +00:00
|
|
|
require 'mongo/types/code'
|
2009-01-13 15:23:20 +00:00
|
|
|
require 'mongo/types/dbref'
|
|
|
|
require 'mongo/types/objectid'
|
|
|
|
require 'mongo/types/regexp_of_holding'
|
2010-01-20 23:50:07 +00:00
|
|
|
require 'mongo/types/min_max_keys'
|
2009-01-13 14:12:13 +00:00
|
|
|
|
2009-10-22 18:10:12 +00:00
|
|
|
require 'mongo/util/support'
|
2009-10-26 19:34:45 +00:00
|
|
|
require 'mongo/util/conversions'
|
2009-10-26 18:54:33 +00:00
|
|
|
require 'mongo/util/server_version'
|
2009-12-01 22:23:24 +00:00
|
|
|
require 'mongo/util/bson_ruby'
|
2009-10-20 19:44:46 +00:00
|
|
|
|
2010-01-11 16:38:35 +00:00
|
|
|
require 'mongo/admin'
|
|
|
|
require 'mongo/collection'
|
2009-08-20 22:48:09 +00:00
|
|
|
require 'mongo/connection'
|
2008-11-22 01:00:51 +00:00
|
|
|
require 'mongo/cursor'
|
2010-01-11 16:38:35 +00:00
|
|
|
require 'mongo/db'
|
|
|
|
require 'mongo/exceptions'
|
2010-01-05 22:42:52 +00:00
|
|
|
require 'mongo/gridfs'
|