monga 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,13 +42,13 @@ module Monga::Connections
42
42
  end
43
43
  @position = 0
44
44
 
45
- @response
45
+ @response unless @response.empty?
46
46
  end
47
47
  end
48
48
 
49
49
  def parse_meta
50
- return if @buffer_size < 36
51
50
  @response.clear
51
+ return if @buffer_size < 36
52
52
  @response << ::BinUtils.get_int32_le(@buffer, @position)
53
53
  @response << ::BinUtils.get_int32_le(@buffer, @position += 4)
54
54
  @response << ::BinUtils.get_int32_le(@buffer, @position += 4)
@@ -67,9 +67,9 @@ module Monga::Connections
67
67
  @str_io = nil if @number_returned == @response[7]
68
68
 
69
69
  current_pos = @position
70
- while (l = @buffer_size - @position) > 4
70
+ while @number_returned > 0
71
71
  doc_length = ::BinUtils.get_int32_le(@buffer, @position)
72
- break if l < doc_length
72
+ break if @buffer_size - @position < doc_length
73
73
  @number_returned -= 1
74
74
  @position += doc_length
75
75
  end
data/monga.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "monga"
7
- spec.version = "0.0.8"
7
+ spec.version = "0.0.9"
8
8
  spec.authors = ["Petr Yanovich"]
9
9
  spec.email = ["fl00r@yandex.ru"]
10
10
  spec.description = %q{Yet another MongoDB Ruby Client}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-03 00:00:00.000000000 Z
12
+ date: 2013-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  segments:
183
183
  - 0
184
- hash: 4381125607140574602
184
+ hash: -2074336869759750845
185
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  none: false
187
187
  requirements:
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  segments:
192
192
  - 0
193
- hash: 4381125607140574602
193
+ hash: -2074336869759750845
194
194
  requirements: []
195
195
  rubyforge_project:
196
196
  rubygems_version: 1.8.25