From 30cce6322efa5555c2042420434753d1b56bd1a2 Mon Sep 17 00:00:00 2001 From: thickpaddy Date: Tue, 28 Dec 2010 10:40:55 +0000 Subject: [PATCH] Update check for little endian to work with ruby 1.8.6 --- lib/bson.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bson.rb b/lib/bson.rb index fefe47f..6e75733 100644 --- a/lib/bson.rb +++ b/lib/bson.rb @@ -47,7 +47,7 @@ else 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 + raise LoadError unless "\x01\x00\x00\x00".unpack("i").first == 1 require 'bson_ext/cbson' raise LoadError unless defined?(CBson::VERSION)