groonga-command-parser 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2f5dd8bb9f225dd59a1441b1ee4ba18fc7b1d74
4
- data.tar.gz: f202a12f7824fbdfd1bdf7dd31fc1542464d5868
3
+ metadata.gz: 80b66bb089e2eadb42d743db7c71baf82b4d165c
4
+ data.tar.gz: 60d236172a8301558d9961fe81f15fbfe9f66161
5
5
  SHA512:
6
- metadata.gz: b056beeb0f6dd1971ba3e2688d0a623e57f88c7d9389df817b81e09583626adf3d596c98434f21e88b6d28c1aded38125dd8e08ba1550eb41a0e818d6ec80050
7
- data.tar.gz: 66c6b6d7739e3889f1e205054ed600f830dcd9ecb1816f33a72af916fadd46d5a8037200e31b8536c4405d94d48804aa3ac56df0a3130fae5e014184dcecc01d
6
+ metadata.gz: 006c544ddaf5d9d64529bed581ecab6c8606ec1229d3c2780b5af2b745d36409dd8210a328c9bb84c3ce5ba288b772e2b0a7140703939df7cff8b5047b77a0a7
7
+ data.tar.gz: db6660cc03650a070685218ffc7f3350156a4ed273498fa38e67b6e42fa7f7b0e2e4f489da9a151ce9e6518bc2d30ebdee4cfbc85354a11e7bba5c4862eb8099
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.1.1: 2017-10-31
4
+
5
+ ### Fixes
6
+
7
+ * Fixed an infinite loop bug on parsing `load`.
8
+
3
9
  ## 1.1.0: 2017-10-30
4
10
 
5
11
  ### Improvements
@@ -358,7 +358,10 @@ module Groonga
358
358
  end
359
359
  end
360
360
  @load_values_parser.on_consumed = lambda do |consumed|
361
- @command.original_source << consumed if @loading
361
+ if @loading
362
+ @command.original_source << consumed
363
+ @buffer = @buffer[consumed.bytesize..-1]
364
+ end
362
365
  end
363
366
  @load_values_parser.on_end = lambda do |rest|
364
367
  loading = @loading
@@ -17,7 +17,7 @@
17
17
  module Groonga
18
18
  module Command
19
19
  class Parser
20
- VERSION = "1.1.0"
20
+ VERSION = "1.1.1"
21
21
  end
22
22
  end
23
23
  end
data/test/test-parser.rb CHANGED
@@ -341,7 +341,7 @@ load --table Users
341
341
  end
342
342
  end
343
343
 
344
- def test_multiple
344
+ def test_multiple_bulk
345
345
  @parser << <<-COMMANDS
346
346
  load --table Users
347
347
  [
@@ -387,6 +387,57 @@ load --table Users
387
387
  assert_equal(expected_events, @events)
388
388
  end
389
389
 
390
+ def test_multiple_line
391
+ commands = <<-COMMANDS
392
+ load --table Users
393
+ [
394
+ {"_key": "alice", "name": "Alice"}
395
+ ]
396
+
397
+ load --table Users
398
+ [
399
+ {"_key": "bob", "name": "Bob"}
400
+ ]
401
+ COMMANDS
402
+ commands.each_line do |line|
403
+ @parser << line
404
+ end
405
+
406
+ expected_events = []
407
+
408
+ expected_events << [:load_start, <<-SOURCE.chomp]
409
+ load --table Users
410
+ SOURCE
411
+ value = {"_key" => "alice", "name" => "Alice"}
412
+ expected_events << [:load_value, <<-SOURCE, value]
413
+ load --table Users
414
+ [
415
+ SOURCE
416
+ expected_events << [:load_complete, <<-SOURCE.chomp]
417
+ load --table Users
418
+ [
419
+ {"_key": "alice", "name": "Alice"}
420
+ ]
421
+ SOURCE
422
+
423
+ expected_events << [:load_start, <<-SOURCE.chomp]
424
+ load --table Users
425
+ SOURCE
426
+ value = {"_key" => "bob", "name" => "Bob"}
427
+ expected_events << [:load_value, <<-SOURCE, value]
428
+ load --table Users
429
+ [
430
+ SOURCE
431
+ expected_events << [:load_complete, <<-SOURCE.chomp]
432
+ load --table Users
433
+ [
434
+ {"_key": "bob", "name": "Bob"}
435
+ ]
436
+ SOURCE
437
+
438
+ assert_equal(expected_events, @events)
439
+ end
440
+
390
441
  class ErrorTest < self
391
442
  def test_location
392
443
  message = "record separate comma is missing"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-command-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-30 00:00:00.000000000 Z
11
+ date: 2017-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: groonga-command