poliqarpr 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ 0.1.10
2
+ - Fix same single-result queries with different buffer size
3
+
1
4
  0.1.9
2
5
  - Change the default buffer size to 5000
3
6
  - Fix buffer resize
@@ -394,7 +394,7 @@ module Poliqarp
394
394
  # and the answer is sent to the handler. In this case
395
395
  # the result returned by make_query should be IGNORED!
396
396
  def make_query(query, should_wait=false,&handler)
397
- if @last_query != query
397
+ if @last_query != query || @last_buffer_size != config.buffer_size
398
398
  if @last_query != nil
399
399
  begin
400
400
  talk("CANCEL")
@@ -404,8 +404,11 @@ module Poliqarp
404
404
  # this is ok - there might be no job running
405
405
  end
406
406
  end
407
+ if @last_query != query
408
+ talk("MAKE-QUERY #{query}")
409
+ end
407
410
  @last_query = query
408
- talk("MAKE-QUERY #{query}")
411
+ @last_buffer_size = config.buffer_size
409
412
  start_waiting if should_wait
410
413
  run_query
411
414
  result = talk("RUN-QUERY #{config.buffer_size}", :async, &handler)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "poliqarpr"
3
- s.version = "0.1.9"
3
+ s.version = "0.1.10"
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
  s.summary = "Ruby client for Poliqarp"
6
6
  s.email = "apohllo@o2.pl"
@@ -72,6 +72,13 @@ describe Poliqarp::Client do
72
72
  @client.find("a").size.should == 5010
73
73
  end
74
74
 
75
+ it "should run a new query if the buffer was resized, even if the last query is the same" do
76
+ @client.config.buffer_size = 100
77
+ @client.find("a",:index => 1)
78
+ @client.config.buffer_size = 200
79
+ @client.find("a", :index => 150)
80
+ end
81
+
75
82
  it "should allow to set and get the right context size" do
76
83
  @client.config.right_context_size = 5
77
84
  @client.config.right_context_size.should == 5
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: poliqarpr
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.9
5
+ version: 0.1.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - Aleksander Pohl
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-10 00:00:00 +01:00
13
+ date: 2011-03-12 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies: []
16
16