lib/bson.rb in bson-1.1.2 vs lib/bson.rb in bson-1.1.3

- old
+ new

@@ -1,13 +1,13 @@ # encoding: UTF-8 $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -MINIMUM_BSON_EXT_VERSION = "1.1.2" +MINIMUM_BSON_EXT_VERSION = "1.1.3" module BSON - VERSION = "1.1.2" + VERSION = "1.1.3" def self.serialize(obj, check_keys=false, move_id=false) BSON_CODER.serialize(obj, check_keys, move_id) end @@ -43,9 +43,13 @@ end else begin # 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 unless little endian + raise LoadError unless [1,0,0,0].pack("i").bytes.first == 1 + require 'bson_ext/cbson' 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