Cleaned up BSON gem versioning.

This commit is contained in:
Kyle Banker 2012-02-28 12:04:49 -05:00
parent 311623d81d
commit 73f9acf4fb
2 changed files with 6 additions and 8 deletions

View File

@ -16,11 +16,9 @@
# limitations under the License. # limitations under the License.
# ++ # ++
MINIMUM_BSON_EXT_VERSION = "1.6.0" require 'bson/version'
module BSON module BSON
VERSION = "1.6.0"
if defined? Mongo::DEFAULT_MAX_BSON_SIZE if defined? Mongo::DEFAULT_MAX_BSON_SIZE
DEFAULT_MAX_BSON_SIZE = Mongo::DEFAULT_MAX_BSON_SIZE DEFAULT_MAX_BSON_SIZE = Mongo::DEFAULT_MAX_BSON_SIZE
else else
@ -65,15 +63,12 @@ else
# Need this for running test with and without c ext in Ruby 1.9. # Need this for running test with and without c ext in Ruby 1.9.
raise LoadError if ENV['TEST_MODE'] && !ENV['C_EXT'] raise LoadError if ENV['TEST_MODE'] && !ENV['C_EXT']
# Raise LoadError unless little endian # Raise LoadError unless little endian, since the C extensions
# only work on little-endian architectures.
raise LoadError unless "\x01\x00\x00\x00".unpack("i").first == 1 raise LoadError unless "\x01\x00\x00\x00".unpack("i").first == 1
require 'bson_ext/cbson' require 'bson_ext/cbson'
raise LoadError unless defined?(CBson::VERSION) raise LoadError unless defined?(CBson::VERSION)
if CBson::VERSION < MINIMUM_BSON_EXT_VERSION
puts "Able to load bson_ext version #{CBson::VERSION}, but >= #{MINIMUM_BSON_EXT_VERSION} is required."
raise LoadError
end
require 'bson/bson_c' require 'bson/bson_c'
module BSON module BSON
BSON_CODER = BSON_C BSON_CODER = BSON_C

3
lib/bson/version.rb Normal file
View File

@ -0,0 +1,3 @@
module BSON
VERSION = "1.6.1"
end