mongodb-mongo 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,14 +66,10 @@ class ByteBuffer
66
66
  @cursor += array.length
67
67
  end
68
68
 
69
- if RUBY_VERSION >= '1.9'
70
- def put_int(i, offset=nil)
71
- put_array([i].pack(@int_pack_order).split(//).collect{|c| c.bytes.first}, offset)
72
- end
73
- else
74
- def put_int(i, offset=nil)
75
- put_array([i].pack(@int_pack_order).split(//).collect{|c| c[0]}, offset)
76
- end
69
+ def put_int(i, offset=nil)
70
+ a = []
71
+ [i].pack(@int_pack_order).each_byte { |b| a << b }
72
+ put_array(a, offset)
77
73
  end
78
74
 
79
75
  def put_long(i, offset=nil)
@@ -87,14 +83,10 @@ class ByteBuffer
87
83
  end
88
84
  end
89
85
 
90
- if RUBY_VERSION >= '1.9'
91
- def put_double(d, offset=nil)
92
- put_array([d].pack(@double_pack_order).split(//).collect{|c| c.bytes.first}, offset)
93
- end
94
- else
95
- def put_double(d, offset=nil)
96
- put_array([d].pack(@double_pack_order).split(//).collect{|c| c[0]}, offset)
97
- end
86
+ def put_double(d, offset=nil)
87
+ a = []
88
+ [d].pack(@double_pack_order).each_byte { |b| a << b }
89
+ put_array(a, offset)
98
90
  end
99
91
 
100
92
  # If +size+ == nil, returns one byte. Else returns array of bytes of length
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mongo'
3
- s.version = '0.2.1'
3
+ s.version = '0.2.2'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = 'Simple pure-Ruby driver for the 10gen Mongo DB'
6
6
  s.description = 'A pure-Ruby driver for the 10gen Mongo DB. For more information about Mongo, see http://www.mongodb.org.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongodb-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Menard