groonga-command-parser 1.1.4 → 1.1.6
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 +5 -5
- data/Gemfile +15 -2
- data/Rakefile +12 -2
- data/doc/text/news.md +14 -0
- data/groonga-command-parser.gemspec +3 -11
- data/lib/groonga/command/parser/command-line-splitter.rb +2 -2
- data/lib/groonga/command/parser/error.rb +2 -4
- data/lib/groonga/command/parser/load-values-parser.rb +30 -74
- data/lib/groonga/command/parser/version.rb +2 -2
- data/lib/groonga/command/parser.rb +12 -4
- data/test/groonga-command-parser-test-utils.rb +2 -4
- data/test/run-test.rb +1 -4
- data/test/test-load-value-parser.rb +2 -1
- data/test/test-parser.rb +13 -10
- metadata +9 -111
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9d2732d80ac847ecb242974d4c41f668b16127259aa9a00b6b08cc9df1c98dc1
|
|
4
|
+
data.tar.gz: 4a343d65d98ab9921ddb8772ec567c6dfafd43e4010df282a0da7c5e18a7ab03
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8e207e4f3b9840ecd63cf2e8ef85c863d20d1a0e2ba0e7962ac7c9080fe203beb2c55e982dc210d7c602d5af7a69f2017e9fa6d24ff56e7d3f822255bf66c4d
|
|
7
|
+
data.tar.gz: 53d721be38d3c803d01659d06f72b3226bd2c47a6e28be0da165888b1ccefb67ca027b8c08997b9e8c99b8d447e7645d87595c82ce9b929f08f3207975555f39
|
data/Gemfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# -*-
|
|
1
|
+
# -*- ruby -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012 Kouhei
|
|
3
|
+
# Copyright (C) 2012-2026 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
#
|
|
5
5
|
# This library is free software; you can redistribute it and/or
|
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -19,3 +19,16 @@
|
|
|
19
19
|
source "https://rubygems.org/"
|
|
20
20
|
|
|
21
21
|
gemspec
|
|
22
|
+
|
|
23
|
+
gem "json", git: "https://github.com/ruby/json.git"
|
|
24
|
+
|
|
25
|
+
group :development do
|
|
26
|
+
gem "kramdown"
|
|
27
|
+
gem "packnga"
|
|
28
|
+
gem "rake"
|
|
29
|
+
gem "yard"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
group :test do
|
|
33
|
+
gem "test-unit"
|
|
34
|
+
end
|
data/Rakefile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# -*- mode: ruby
|
|
1
|
+
# -*- mode: ruby -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012 Kouhei
|
|
3
|
+
# Copyright (C) 2012-2024 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
#
|
|
5
5
|
# This library is free software; you can redistribute it and/or
|
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -43,3 +43,13 @@ desc "Run tests"
|
|
|
43
43
|
task :test do
|
|
44
44
|
ruby("test/run-test.rb")
|
|
45
45
|
end
|
|
46
|
+
|
|
47
|
+
release_task = Rake.application["release"]
|
|
48
|
+
# We use Trusting Publishing
|
|
49
|
+
release_task.prerequisites.delete("build")
|
|
50
|
+
release_task.prerequisites.delete("release:rubygem_push")
|
|
51
|
+
release_task_comment = release_task.comment
|
|
52
|
+
if release_task_comment
|
|
53
|
+
release_task.clear_comments
|
|
54
|
+
release_task.comment = release_task_comment.gsub(/ and build.*$/, "")
|
|
55
|
+
end
|
data/doc/text/news.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# News
|
|
2
2
|
|
|
3
|
+
## 1.1.6: 2026-06-25
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
* Migrated to json gem from json-stream gem.
|
|
8
|
+
|
|
9
|
+
* Dropped support for Ruby 2.6.
|
|
10
|
+
|
|
11
|
+
## 1.1.5: 2024-12-24
|
|
12
|
+
|
|
13
|
+
### Improvements
|
|
14
|
+
|
|
15
|
+
* Suppressed warnings with Ruby 3.4.
|
|
16
|
+
|
|
3
17
|
## 1.1.4: 2019-03-26
|
|
4
18
|
|
|
5
19
|
### Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# -*- mode: ruby
|
|
1
|
+
# -*- mode: ruby -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012-
|
|
3
|
+
# Copyright (C) 2012-2026 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
#
|
|
5
5
|
# This library is free software; you can redistribute it and/or
|
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -53,14 +53,6 @@ Gem::Specification.new do |spec|
|
|
|
53
53
|
spec.require_paths = ["lib"]
|
|
54
54
|
|
|
55
55
|
spec.add_runtime_dependency("groonga-command", ">= 1.4.0")
|
|
56
|
-
spec.add_runtime_dependency("json
|
|
57
|
-
|
|
58
|
-
spec.add_development_dependency("test-unit")
|
|
59
|
-
spec.add_development_dependency("test-unit-notify")
|
|
60
|
-
spec.add_development_dependency("rake")
|
|
61
|
-
spec.add_development_dependency("bundler")
|
|
62
|
-
spec.add_development_dependency("packnga")
|
|
63
|
-
spec.add_development_dependency("yard")
|
|
64
|
-
spec.add_development_dependency("kramdown")
|
|
56
|
+
spec.add_runtime_dependency("json", ">= 2.20.0")
|
|
65
57
|
end
|
|
66
58
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2015 Kouhei
|
|
1
|
+
# Copyright (C) 2015-2024 Sutou Kouhei <kou@clear-code.com>
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -32,7 +32,7 @@ module Groonga
|
|
|
32
32
|
start_quote = nil
|
|
33
33
|
until scanner.eos?
|
|
34
34
|
if start_quote
|
|
35
|
-
token = ""
|
|
35
|
+
token = +""
|
|
36
36
|
loop do
|
|
37
37
|
chunk = scanner.scan_until(/#{Regexp.escape(start_quote)}/)
|
|
38
38
|
if chunk.nil?
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
|
|
1
|
+
# Copyright (C) 2011-2024 Sutou Kouhei <kou@clear-code.com>
|
|
4
2
|
#
|
|
5
3
|
# This library is free software; you can redistribute it and/or
|
|
6
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -31,7 +29,7 @@ module Groonga
|
|
|
31
29
|
|
|
32
30
|
private
|
|
33
31
|
def compute_location(before, after)
|
|
34
|
-
location = ""
|
|
32
|
+
location = +""
|
|
35
33
|
if before[-1] == ?\n
|
|
36
34
|
location << before
|
|
37
35
|
location << after
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2015-
|
|
1
|
+
# Copyright (C) 2015-2026 Sutou Kouhei <kou@clear-code.com>
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# License along with this library; if not, write to the Free Software
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
16
16
|
|
|
17
|
-
require "json
|
|
17
|
+
require "json"
|
|
18
18
|
|
|
19
19
|
module Groonga
|
|
20
20
|
module Command
|
|
@@ -24,35 +24,44 @@ module Groonga
|
|
|
24
24
|
attr_writer :on_consumed
|
|
25
25
|
attr_writer :on_end
|
|
26
26
|
def initialize
|
|
27
|
-
|
|
27
|
+
@parser = JSON::ResumableParser.new
|
|
28
28
|
@on_value = nil
|
|
29
29
|
@on_consumed = nil
|
|
30
30
|
@on_end = nil
|
|
31
|
-
@
|
|
32
|
-
@keys = []
|
|
31
|
+
@n_processed_values = 0
|
|
33
32
|
end
|
|
34
33
|
|
|
35
34
|
def <<(data)
|
|
36
35
|
data_size = data.bytesize
|
|
37
36
|
return self if data_size.zero?
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
@parser << data
|
|
39
|
+
begin
|
|
40
|
+
done = @parser.parse
|
|
41
|
+
rescue JSON::ParserError => error
|
|
42
|
+
consumed = data_size - @parser.rest.bytesize
|
|
43
|
+
raise Error.new(error.message,
|
|
44
|
+
data[0, consumed],
|
|
45
|
+
data[consumed..-1])
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
if done
|
|
49
|
+
@parser.value[@n_processed_values..-1].each do |value|
|
|
50
|
+
@on_value.call(value)
|
|
51
|
+
end
|
|
52
|
+
@n_processed_values = 0
|
|
53
|
+
else
|
|
54
|
+
partial_value = @parser.partial_value
|
|
55
|
+
if partial_value
|
|
56
|
+
partial_value[@n_processed_values..-2].each do |value|
|
|
57
|
+
@on_value.call(value)
|
|
58
|
+
end
|
|
59
|
+
@n_processed_values = partial_value.size - 1
|
|
50
60
|
end
|
|
51
|
-
:continue
|
|
52
61
|
end
|
|
53
62
|
|
|
54
|
-
|
|
55
|
-
consumed
|
|
63
|
+
consumed = data.bytesize
|
|
64
|
+
consumed -= @parser.rest.bytesize if done
|
|
56
65
|
if consumed > 0
|
|
57
66
|
if consumed < data_size
|
|
58
67
|
@on_consumed.call(data[0, consumed])
|
|
@@ -60,7 +69,8 @@ module Groonga
|
|
|
60
69
|
@on_consumed.call(data)
|
|
61
70
|
end
|
|
62
71
|
end
|
|
63
|
-
|
|
72
|
+
|
|
73
|
+
if done
|
|
64
74
|
if consumed < data_size
|
|
65
75
|
@on_end.call(data[consumed..-1])
|
|
66
76
|
else
|
|
@@ -70,60 +80,6 @@ module Groonga
|
|
|
70
80
|
|
|
71
81
|
self
|
|
72
82
|
end
|
|
73
|
-
|
|
74
|
-
private
|
|
75
|
-
def initialize_parser
|
|
76
|
-
@parser = JSON::Stream::Parser.new
|
|
77
|
-
@parser.singleton_class.__send__(:attr_reader, :pos)
|
|
78
|
-
@parser.end_document do
|
|
79
|
-
throw(@tag, :done)
|
|
80
|
-
end
|
|
81
|
-
@parser.start_object do
|
|
82
|
-
push_container({})
|
|
83
|
-
end
|
|
84
|
-
@parser.end_object do
|
|
85
|
-
pop_container
|
|
86
|
-
end
|
|
87
|
-
@parser.start_array do
|
|
88
|
-
push_container([])
|
|
89
|
-
end
|
|
90
|
-
@parser.end_array do
|
|
91
|
-
pop_container
|
|
92
|
-
end
|
|
93
|
-
@parser.key do |key|
|
|
94
|
-
push_key(key)
|
|
95
|
-
end
|
|
96
|
-
@parser.value do |value|
|
|
97
|
-
push_value(value)
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
def push_container(container)
|
|
102
|
-
@containers.push(container)
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
def pop_container
|
|
106
|
-
container = @containers.pop
|
|
107
|
-
if @containers.size == 1
|
|
108
|
-
@on_value.call(container)
|
|
109
|
-
else
|
|
110
|
-
push_value(container)
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def push_key(key)
|
|
115
|
-
@keys.push(key)
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def push_value(value)
|
|
119
|
-
container = @containers.last
|
|
120
|
-
case container
|
|
121
|
-
when ::Hash
|
|
122
|
-
container[@keys.pop] = value
|
|
123
|
-
when ::Array
|
|
124
|
-
container.push(value)
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
83
|
end
|
|
128
84
|
end
|
|
129
85
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2013-
|
|
1
|
+
# Copyright (C) 2013-2024 Sutou Kouhei <kou@clear-code.com>
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
module Groonga
|
|
18
18
|
module Command
|
|
19
19
|
class Parser
|
|
20
|
-
VERSION = "1.1.
|
|
20
|
+
VERSION = "1.1.6"
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2011-
|
|
1
|
+
# Copyright (C) 2011-2026 Sutou Kouhei <kou@clear-code.com>
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -15,7 +15,13 @@
|
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
16
16
|
|
|
17
17
|
require "English"
|
|
18
|
-
require "cgi"
|
|
18
|
+
require "cgi/escape"
|
|
19
|
+
begin
|
|
20
|
+
CGI.unescape("")
|
|
21
|
+
rescue NameError
|
|
22
|
+
# Ruby < 4.0 need cgi for CGI.unescape.
|
|
23
|
+
require "cgi"
|
|
24
|
+
end
|
|
19
25
|
require "json"
|
|
20
26
|
|
|
21
27
|
require "groonga/command"
|
|
@@ -345,7 +351,8 @@ module Groonga
|
|
|
345
351
|
def reset
|
|
346
352
|
@command = nil
|
|
347
353
|
@loading = false
|
|
348
|
-
@buffer = ""
|
|
354
|
+
@buffer = +""
|
|
355
|
+
@buffer.force_encoding("ASCII-8BIT")
|
|
349
356
|
@load_values_parser = nil
|
|
350
357
|
end
|
|
351
358
|
|
|
@@ -371,7 +378,8 @@ module Groonga
|
|
|
371
378
|
if @loading
|
|
372
379
|
@command.original_source << consumed if @need_original_source
|
|
373
380
|
if @buffer.bytesize == consumed.bytesize
|
|
374
|
-
@buffer = ""
|
|
381
|
+
@buffer = +""
|
|
382
|
+
@buffer.force_encoding("ASCII-8BIT")
|
|
375
383
|
else
|
|
376
384
|
@buffer = @buffer[consumed.bytesize..-1]
|
|
377
385
|
end
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
|
|
1
|
+
# Copyright (C) 2011-2026 Sutou Kouhei <kou@clear-code.com>
|
|
4
2
|
#
|
|
5
3
|
# This library is free software; you can redistribute it and/or
|
|
6
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -16,7 +14,7 @@
|
|
|
16
14
|
# License along with this library; if not, write to the Free Software
|
|
17
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18
16
|
|
|
19
|
-
require "cgi"
|
|
17
|
+
require "cgi/escape"
|
|
20
18
|
require "stringio"
|
|
21
19
|
|
|
22
20
|
require "groonga/command/parser"
|
data/test/run-test.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012-
|
|
3
|
+
# Copyright (C) 2012-2024 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
#
|
|
5
5
|
# This library is free software; you can redistribute it and/or
|
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -23,9 +23,6 @@ lib_dir = File.join(base_dir, "lib")
|
|
|
23
23
|
test_dir = File.join(base_dir, "test")
|
|
24
24
|
|
|
25
25
|
require "test-unit"
|
|
26
|
-
require "test/unit/notify"
|
|
27
|
-
|
|
28
|
-
Test::Unit::Priority.enable
|
|
29
26
|
|
|
30
27
|
groonga_command_dir = File.join(base_dir, "..", "groonga-command")
|
|
31
28
|
groonga_command_dir = File.expand_path(groonga_command_dir)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2015 Kouhei
|
|
1
|
+
# Copyright (C) 2015-2026 Sutou Kouhei <kou@clear-code.com>
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -155,6 +155,7 @@ class LoadValuesParserTest < Test::Unit::TestCase
|
|
|
155
155
|
|
|
156
156
|
sub_test_case "error" do
|
|
157
157
|
test "unfinished" do
|
|
158
|
+
omit("We can't implement this with JSON::ResumableParser")
|
|
158
159
|
assert_equal([
|
|
159
160
|
{
|
|
160
161
|
"object" => {
|
data/test/test-parser.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2011-
|
|
1
|
+
# Copyright (C) 2011-2026 Sutou Kouhei <kou@clear-code.com>
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -270,7 +270,7 @@ load --table Users --columns "_key, name"
|
|
|
270
270
|
expected_events << [:load_value, <<-COMMAND, ["alice", "Alice"]]
|
|
271
271
|
load --table Users --columns "_key, name"
|
|
272
272
|
COMMAND
|
|
273
|
-
expected_events << [:load_complete, <<-COMMAND
|
|
273
|
+
expected_events << [:load_complete, <<-COMMAND]
|
|
274
274
|
load --table Users --columns "_key, name"
|
|
275
275
|
[
|
|
276
276
|
["alice", "Alice"]
|
|
@@ -298,7 +298,7 @@ load --table Users
|
|
|
298
298
|
expected_events << [:load_value, <<-COMMAND, ["alice", "Alice"]]
|
|
299
299
|
load --table Users
|
|
300
300
|
COMMAND
|
|
301
|
-
expected_events << [:load_complete, <<-COMMAND
|
|
301
|
+
expected_events << [:load_complete, <<-COMMAND]
|
|
302
302
|
load --table Users
|
|
303
303
|
[
|
|
304
304
|
["_key", "name"],
|
|
@@ -330,7 +330,7 @@ load --table Users
|
|
|
330
330
|
expected_events << [:load_value, <<-COMMAND, value]
|
|
331
331
|
load --table Users
|
|
332
332
|
COMMAND
|
|
333
|
-
expected_events << [:load_complete, <<-COMMAND
|
|
333
|
+
expected_events << [:load_complete, <<-COMMAND]
|
|
334
334
|
load --table Users
|
|
335
335
|
[
|
|
336
336
|
{"_key": "alice", "name": "Alice"},
|
|
@@ -363,11 +363,12 @@ load --table Users
|
|
|
363
363
|
expected_events << [:load_value, <<-SOURCE, value]
|
|
364
364
|
load --table Users
|
|
365
365
|
SOURCE
|
|
366
|
-
expected_events << [:load_complete, <<-SOURCE
|
|
366
|
+
expected_events << [:load_complete, <<-SOURCE]
|
|
367
367
|
load --table Users
|
|
368
368
|
[
|
|
369
369
|
{"_key": "alice", "name": "Alice"}
|
|
370
370
|
]
|
|
371
|
+
|
|
371
372
|
SOURCE
|
|
372
373
|
|
|
373
374
|
expected_events << [:load_start, <<-SOURCE.chomp]
|
|
@@ -377,7 +378,7 @@ load --table Users
|
|
|
377
378
|
expected_events << [:load_value, <<-SOURCE, value]
|
|
378
379
|
load --table Users
|
|
379
380
|
SOURCE
|
|
380
|
-
expected_events << [:load_complete, <<-SOURCE
|
|
381
|
+
expected_events << [:load_complete, <<-SOURCE]
|
|
381
382
|
load --table Users
|
|
382
383
|
[
|
|
383
384
|
{"_key": "bob", "name": "Bob"}
|
|
@@ -412,8 +413,9 @@ load --table Users
|
|
|
412
413
|
expected_events << [:load_value, <<-SOURCE, value]
|
|
413
414
|
load --table Users
|
|
414
415
|
[
|
|
416
|
+
{"_key": "alice", "name": "Alice"}
|
|
415
417
|
SOURCE
|
|
416
|
-
expected_events << [:load_complete, <<-SOURCE
|
|
418
|
+
expected_events << [:load_complete, <<-SOURCE]
|
|
417
419
|
load --table Users
|
|
418
420
|
[
|
|
419
421
|
{"_key": "alice", "name": "Alice"}
|
|
@@ -427,8 +429,9 @@ load --table Users
|
|
|
427
429
|
expected_events << [:load_value, <<-SOURCE, value]
|
|
428
430
|
load --table Users
|
|
429
431
|
[
|
|
432
|
+
{"_key": "bob", "name": "Bob"}
|
|
430
433
|
SOURCE
|
|
431
|
-
expected_events << [:load_complete, <<-SOURCE
|
|
434
|
+
expected_events << [:load_complete, <<-SOURCE]
|
|
432
435
|
load --table Users
|
|
433
436
|
[
|
|
434
437
|
{"_key": "bob", "name": "Bob"}
|
|
@@ -453,7 +456,7 @@ EOS
|
|
|
453
456
|
end
|
|
454
457
|
|
|
455
458
|
def test_no_record_separate_comma
|
|
456
|
-
message = "
|
|
459
|
+
message = "expected ',' or ']' after array value"
|
|
457
460
|
before = <<-BEFORE
|
|
458
461
|
[
|
|
459
462
|
{"_key": "alice", "name": "Alice"}
|
|
@@ -473,7 +476,7 @@ EOC
|
|
|
473
476
|
end
|
|
474
477
|
|
|
475
478
|
def test_garbage_before_json
|
|
476
|
-
message = "
|
|
479
|
+
message = "unexpected character: 'XXX'"
|
|
477
480
|
before = ""
|
|
478
481
|
after = <<-AFTER
|
|
479
482
|
XXX
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: groonga-command-parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kouhei Sutou
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: groonga-command
|
|
@@ -25,117 +24,19 @@ dependencies:
|
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: 1.4.0
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: json
|
|
27
|
+
name: json
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
32
|
+
version: 2.20.0
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: test-unit
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: test-unit-notify
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - ">="
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: rake
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: bundler
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - ">="
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '0'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - ">="
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: packnga
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: yard
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - ">="
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - ">="
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
125
|
-
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: kramdown
|
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
|
128
|
-
requirements:
|
|
129
|
-
- - ">="
|
|
130
|
-
- !ruby/object:Gem::Version
|
|
131
|
-
version: '0'
|
|
132
|
-
type: :development
|
|
133
|
-
prerelease: false
|
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - ">="
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: '0'
|
|
39
|
+
version: 2.20.0
|
|
139
40
|
description: ''
|
|
140
41
|
email:
|
|
141
42
|
- kou@clear-code.com
|
|
@@ -173,7 +74,6 @@ homepage: https://github.com/groonga/groonga-command-parser
|
|
|
173
74
|
licenses:
|
|
174
75
|
- LGPLv2.1+
|
|
175
76
|
metadata: {}
|
|
176
|
-
post_install_message:
|
|
177
77
|
rdoc_options: []
|
|
178
78
|
require_paths:
|
|
179
79
|
- lib
|
|
@@ -188,15 +88,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
188
88
|
- !ruby/object:Gem::Version
|
|
189
89
|
version: '0'
|
|
190
90
|
requirements: []
|
|
191
|
-
|
|
192
|
-
rubygems_version: 2.5.2.1
|
|
193
|
-
signing_key:
|
|
91
|
+
rubygems_version: 4.0.10
|
|
194
92
|
specification_version: 4
|
|
195
93
|
summary: Groonga-command-parser is a Ruby library to parses [groonga](http://groonga.org/)'s
|
|
196
94
|
command syntax. You can write a program to process groonga's command by using groonga-command-parser.
|
|
197
95
|
test_files:
|
|
198
|
-
- test/test-load-value-parser.rb
|
|
199
|
-
- test/run-test.rb
|
|
200
|
-
- test/test-parser.rb
|
|
201
96
|
- test/groonga-command-parser-test-utils.rb
|
|
97
|
+
- test/run-test.rb
|
|
202
98
|
- test/test-command-line-splitter.rb
|
|
99
|
+
- test/test-load-value-parser.rb
|
|
100
|
+
- test/test-parser.rb
|