groonga-command 1.4.7 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +35 -0
- data/lib/groonga/command/column-create.rb +8 -1
- data/lib/groonga/command/io-flush.rb +17 -3
- data/lib/groonga/command/load.rb +11 -6
- data/lib/groonga/command/reference-acquire.rb +69 -0
- data/lib/groonga/command/reference-release.rb +69 -0
- data/lib/groonga/command/table-create-similar.rb +51 -0
- data/lib/groonga/command/table-create.rb +8 -1
- data/lib/groonga/command/version.rb +1 -1
- data/lib/groonga/command.rb +4 -1
- data/test/command/test-column-create.rb +25 -3
- data/test/command/test-io-flush.rb +17 -1
- data/test/command/test-reference-acquire.rb +82 -0
- data/test/command/test-reference-release.rb +82 -0
- data/test/command/test-table-create-similar.rb +55 -0
- data/test/command/test-table-create.rb +16 -1
- metadata +55 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47d6a7b2852bae83978ea53afb8cf161900a1d966a858c097b5abe73e1be352e
|
4
|
+
data.tar.gz: 3713f2fd40276e7ac46947792a8aeda9a3c673a9cb02a89883525c1a2c66d663
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a208143568256aa7b498f769e414c5a99677b08884fdb23e2338d2749764ae14a5555ce948ce96269c582fadab0320633f10377b2023f45eaf8960a2d84c083
|
7
|
+
data.tar.gz: 3df454e758a385b3cf85033f3fab4d34aef5592204abeae71ebcda8a12e54d2ed385545658795b2f5a30104d021fd4123ca8ab9cce7c6e28b4d4b536f170b485
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,40 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 1.5.1: 2021-08-24
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* {Groonga::Command::TableCreateSimilar}: Added.
|
8
|
+
|
9
|
+
## 1.5.0: 2020-09-09
|
10
|
+
|
11
|
+
### Improvements
|
12
|
+
|
13
|
+
* {Groonga::Command::TableCreate}: Added support for `path`.
|
14
|
+
|
15
|
+
* {Groonga::Command::ColumnCreate}: Added support for `path`.
|
16
|
+
|
17
|
+
## 1.4.9: 2020-06-14
|
18
|
+
|
19
|
+
### Improvements
|
20
|
+
|
21
|
+
* {Groonga::Command::ReferenceAcquire}: Added support for
|
22
|
+
`reference_acquire`.
|
23
|
+
|
24
|
+
* {Groonga::Command::ReferenceRelease}: Added support for
|
25
|
+
`reference_release`.
|
26
|
+
|
27
|
+
* {Groonga::Command::IOFlush#recursive}: Added.
|
28
|
+
|
29
|
+
* {Groonga::Command::IOFlush#recursive_dependent?}: Added.
|
30
|
+
|
31
|
+
## 1.4.8: 2020-05-03
|
32
|
+
|
33
|
+
### Improvements
|
34
|
+
|
35
|
+
* {Groonga::Command::Load#build_arrow_table}: Added support for
|
36
|
+
float32 weight vector.
|
37
|
+
|
3
38
|
## 1.4.7: 2020-01-10
|
4
39
|
|
5
40
|
### Improvements
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2020 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
|
@@ -31,6 +31,7 @@ module Groonga
|
|
31
31
|
:flags,
|
32
32
|
:type,
|
33
33
|
:source,
|
34
|
+
:path,
|
34
35
|
]
|
35
36
|
end
|
36
37
|
end
|
@@ -110,6 +111,12 @@ module Groonga
|
|
110
111
|
def sources
|
111
112
|
@sources ||= array_value(:source)
|
112
113
|
end
|
114
|
+
|
115
|
+
# @return [String, nil] Path or nil
|
116
|
+
# @since 1.5.0
|
117
|
+
def path
|
118
|
+
self[:path]
|
119
|
+
end
|
113
120
|
end
|
114
121
|
end
|
115
122
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2015 Kouhei
|
1
|
+
# Copyright (C) 2015-2020 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
|
@@ -44,11 +44,25 @@ module Groonga
|
|
44
44
|
self[:target_name]
|
45
45
|
end
|
46
46
|
|
47
|
-
# @return [
|
47
|
+
# @return [String] `recursive` parameter value.
|
48
|
+
#
|
49
|
+
# @since 1.4.9
|
50
|
+
def recursive
|
51
|
+
self[:recursive]
|
52
|
+
end
|
53
|
+
|
54
|
+
# @return [Boolean] Whether `recursive` parameter value isn't `no`.
|
48
55
|
#
|
49
56
|
# @since 1.1.3
|
50
57
|
def recursive?
|
51
|
-
|
58
|
+
recursive != "no"
|
59
|
+
end
|
60
|
+
|
61
|
+
# @return [Boolean] `recursive` parameter value.
|
62
|
+
#
|
63
|
+
# @since 1.4.9
|
64
|
+
def recursive_dependent?
|
65
|
+
recursive == "dependent"
|
52
66
|
end
|
53
67
|
end
|
54
68
|
end
|
data/lib/groonga/command/load.rb
CHANGED
@@ -181,8 +181,8 @@ module Groonga
|
|
181
181
|
data_type ||= :string
|
182
182
|
arrow_array = build_arrow_array(data_type, raw_array)
|
183
183
|
when Hash
|
184
|
-
|
185
|
-
|
184
|
+
data_type = arrow_weight_vector_data_type(sample)
|
185
|
+
arrow_array = build_arrow_array(data_type, raw_array)
|
186
186
|
else
|
187
187
|
data_type = detect_arrow_data_type(raw_array) || :string
|
188
188
|
if data_type == :string
|
@@ -226,9 +226,14 @@ module Groonga
|
|
226
226
|
Arrow::ListArrayBuilder.build(arrow_list_data_type, raw_array)
|
227
227
|
end
|
228
228
|
|
229
|
-
def arrow_weight_vector_data_type
|
229
|
+
def arrow_weight_vector_data_type(raw_value)
|
230
|
+
if raw_value.values.any? {|value| value.is_a?(Float)}
|
231
|
+
weight_type = :float
|
232
|
+
else
|
233
|
+
weight_type = :int32
|
234
|
+
end
|
230
235
|
Arrow::StructDataType.new("value" => :string,
|
231
|
-
"weight" =>
|
236
|
+
"weight" => weight_type)
|
232
237
|
end
|
233
238
|
|
234
239
|
def detect_arrow_data_type(raw_array)
|
@@ -249,8 +254,8 @@ module Groonga
|
|
249
254
|
type = nil if type == :int64
|
250
255
|
type ||= :double
|
251
256
|
when Hash
|
252
|
-
|
253
|
-
|
257
|
+
item_type = arrow_weight_vector_data_type(element)
|
258
|
+
arrow_list_field = Arrow::Field.new("item", item_type)
|
254
259
|
arrow_list_data_type = Arrow::ListDataType.new(arrow_list_field)
|
255
260
|
return arrow_list_data_type
|
256
261
|
else
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Copyright (C) 2020 Sutou Kouhei <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "groonga/command/base"
|
18
|
+
|
19
|
+
module Groonga
|
20
|
+
module Command
|
21
|
+
# A command class that represents `reference_acquire` command.
|
22
|
+
#
|
23
|
+
# @since 1.4.9
|
24
|
+
class ReferenceAcquire < Base
|
25
|
+
class << self
|
26
|
+
def command_name
|
27
|
+
"reference_acquire"
|
28
|
+
end
|
29
|
+
|
30
|
+
def parameter_names
|
31
|
+
[
|
32
|
+
:target_name,
|
33
|
+
:recursive,
|
34
|
+
]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
Command.register(command_name, self)
|
39
|
+
|
40
|
+
# @return [String] `target_name` parameter value.
|
41
|
+
#
|
42
|
+
# @since 1.4.9
|
43
|
+
def target_name
|
44
|
+
self[:target_name]
|
45
|
+
end
|
46
|
+
|
47
|
+
# @return [String] `recursive` parameter value.
|
48
|
+
#
|
49
|
+
# @since 1.4.9
|
50
|
+
def recursive
|
51
|
+
self[:recursive]
|
52
|
+
end
|
53
|
+
|
54
|
+
# @return [Boolean] Whether `recursive` parameter value isn't `no`.
|
55
|
+
#
|
56
|
+
# @since 1.4.9
|
57
|
+
def recursive?
|
58
|
+
recursive != "no"
|
59
|
+
end
|
60
|
+
|
61
|
+
# @return [Boolean] `recursive` parameter value.
|
62
|
+
#
|
63
|
+
# @since 1.4.9
|
64
|
+
def recursive_dependent?
|
65
|
+
recursive == "dependent"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Copyright (C) 2020 Sutou Kouhei <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "groonga/command/base"
|
18
|
+
|
19
|
+
module Groonga
|
20
|
+
module Command
|
21
|
+
# A command class that represents `reference_release` command.
|
22
|
+
#
|
23
|
+
# @since 1.4.9
|
24
|
+
class ReferenceRelease < Base
|
25
|
+
class << self
|
26
|
+
def command_name
|
27
|
+
"reference_release"
|
28
|
+
end
|
29
|
+
|
30
|
+
def parameter_names
|
31
|
+
[
|
32
|
+
:target_name,
|
33
|
+
:recursive,
|
34
|
+
]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
Command.register(command_name, self)
|
39
|
+
|
40
|
+
# @return [String] `target_name` parameter value.
|
41
|
+
#
|
42
|
+
# @since 1.4.9
|
43
|
+
def target_name
|
44
|
+
self[:target_name]
|
45
|
+
end
|
46
|
+
|
47
|
+
# @return [String] `recursive` parameter value.
|
48
|
+
#
|
49
|
+
# @since 1.4.9
|
50
|
+
def recursive
|
51
|
+
self[:recursive]
|
52
|
+
end
|
53
|
+
|
54
|
+
# @return [Boolean] Whether `recursive` parameter value isn't `no`.
|
55
|
+
#
|
56
|
+
# @since 1.4.9
|
57
|
+
def recursive?
|
58
|
+
self[:recursive] != "no"
|
59
|
+
end
|
60
|
+
|
61
|
+
# @return [Boolean] `recursive` parameter value.
|
62
|
+
#
|
63
|
+
# @since 1.4.9
|
64
|
+
def recursive_dependent?
|
65
|
+
self[:recursive] == "dependent"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Copyright (C) 2021 Sutou Kouhei <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "groonga/command/base"
|
18
|
+
|
19
|
+
module Groonga
|
20
|
+
module Command
|
21
|
+
class TableCreateSimilar < Base
|
22
|
+
class << self
|
23
|
+
def command_name
|
24
|
+
"table_create_similar"
|
25
|
+
end
|
26
|
+
|
27
|
+
def parameter_names
|
28
|
+
[
|
29
|
+
:name,
|
30
|
+
:base_table,
|
31
|
+
]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Command.register(command_name, self)
|
36
|
+
|
37
|
+
# @return [String] The new table name.
|
38
|
+
#
|
39
|
+
# @since 1.5.1
|
40
|
+
def name
|
41
|
+
self[:name]
|
42
|
+
end
|
43
|
+
# @return [String] The base table name.
|
44
|
+
#
|
45
|
+
# @since 1.5.1
|
46
|
+
def base_table
|
47
|
+
self[:base_table]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2020 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
|
@@ -33,6 +33,7 @@ module Groonga
|
|
33
33
|
:default_tokenizer,
|
34
34
|
:normalizer,
|
35
35
|
:token_filters,
|
36
|
+
:path,
|
36
37
|
]
|
37
38
|
end
|
38
39
|
end
|
@@ -117,6 +118,12 @@ module Groonga
|
|
117
118
|
def token_filters
|
118
119
|
@token_filters ||= array_value(:token_filters)
|
119
120
|
end
|
121
|
+
|
122
|
+
# @return [String, nil] Path or nil
|
123
|
+
# @since 1.5.0
|
124
|
+
def path
|
125
|
+
self[:path]
|
126
|
+
end
|
120
127
|
end
|
121
128
|
end
|
122
129
|
end
|
data/lib/groonga/command.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2021 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
|
@@ -51,6 +51,8 @@ require "groonga/command/query-log-flags-get"
|
|
51
51
|
require "groonga/command/query-log-flags-remove"
|
52
52
|
require "groonga/command/query-log-flags-set"
|
53
53
|
require "groonga/command/range-filter"
|
54
|
+
require "groonga/command/reference-acquire"
|
55
|
+
require "groonga/command/reference-release"
|
54
56
|
require "groonga/command/register"
|
55
57
|
require "groonga/command/reindex"
|
56
58
|
require "groonga/command/request-cancel"
|
@@ -63,6 +65,7 @@ require "groonga/command/status"
|
|
63
65
|
require "groonga/command/suggest"
|
64
66
|
require "groonga/command/table-copy"
|
65
67
|
require "groonga/command/table-create"
|
68
|
+
require "groonga/command/table-create-similar"
|
66
69
|
require "groonga/command/table-list"
|
67
70
|
require "groonga/command/table-remove"
|
68
71
|
require "groonga/command/table-rename"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2020 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
|
@@ -28,14 +28,24 @@ class ColumnCreateCommandTest < Test::Unit::TestCase
|
|
28
28
|
flags = "COLUMN_INDEX"
|
29
29
|
type = "Posts"
|
30
30
|
source = "content"
|
31
|
-
|
32
|
-
|
31
|
+
path = "Lexicon.content_index"
|
32
|
+
|
33
|
+
command = column_create_command({},
|
34
|
+
[
|
35
|
+
table,
|
36
|
+
name,
|
37
|
+
flags,
|
38
|
+
type,
|
39
|
+
source,
|
40
|
+
path,
|
41
|
+
])
|
33
42
|
assert_equal({
|
34
43
|
:table => table,
|
35
44
|
:name => name,
|
36
45
|
:flags => flags,
|
37
46
|
:type => type,
|
38
47
|
:source => source,
|
48
|
+
:path => path,
|
39
49
|
},
|
40
50
|
command.arguments)
|
41
51
|
end
|
@@ -198,4 +208,16 @@ class ColumnCreateCommandTest < Test::Unit::TestCase
|
|
198
208
|
command.sources)
|
199
209
|
end
|
200
210
|
end
|
211
|
+
|
212
|
+
class PathTest < self
|
213
|
+
def test_specified
|
214
|
+
command = column_create_command({"path" => "Lexicon.content_index"})
|
215
|
+
assert_equal("Lexicon.content_index", command.path)
|
216
|
+
end
|
217
|
+
|
218
|
+
def test_omitted
|
219
|
+
command = column_create_command
|
220
|
+
assert_nil(command.path)
|
221
|
+
end
|
222
|
+
end
|
201
223
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2015 Kouhei
|
1
|
+
# Copyright (C) 2015-2020 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
|
@@ -53,6 +53,9 @@ class IOFlushCommandTest < Test::Unit::TestCase
|
|
53
53
|
assert do
|
54
54
|
command.recursive?
|
55
55
|
end
|
56
|
+
assert do
|
57
|
+
not command.recursive_dependent?
|
58
|
+
end
|
56
59
|
end
|
57
60
|
|
58
61
|
def test_no
|
@@ -60,6 +63,19 @@ class IOFlushCommandTest < Test::Unit::TestCase
|
|
60
63
|
assert do
|
61
64
|
not command.recursive?
|
62
65
|
end
|
66
|
+
assert do
|
67
|
+
not command.recursive_dependent?
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_dependent
|
72
|
+
command = io_flush_command(:recursive => "dependent")
|
73
|
+
assert do
|
74
|
+
command.recursive?
|
75
|
+
end
|
76
|
+
assert do
|
77
|
+
command.recursive_dependent?
|
78
|
+
end
|
63
79
|
end
|
64
80
|
end
|
65
81
|
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Copyright (C) 2020 Sutou Kouhei <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
class ReferenceAcquireCommandTest < Test::Unit::TestCase
|
18
|
+
private
|
19
|
+
def reference_acquire_command(pair_arguments={}, ordered_arguments=[])
|
20
|
+
Groonga::Command::ReferenceAcquire.new(pair_arguments,
|
21
|
+
ordered_arguments)
|
22
|
+
end
|
23
|
+
|
24
|
+
class ConstructorTest < self
|
25
|
+
def test_ordered_arguments
|
26
|
+
target_name = "Users"
|
27
|
+
recursive = "no"
|
28
|
+
|
29
|
+
ordered_arguments = [
|
30
|
+
target_name,
|
31
|
+
recursive,
|
32
|
+
]
|
33
|
+
command = reference_acquire_command({}, ordered_arguments)
|
34
|
+
assert_equal({
|
35
|
+
:target_name => target_name,
|
36
|
+
:recursive => recursive,
|
37
|
+
},
|
38
|
+
command.arguments)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class TargetNameTest < self
|
43
|
+
def test_reader
|
44
|
+
command = reference_acquire_command(:target_name => "Users")
|
45
|
+
assert_equal("Users", command.target_name)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class RecursiveTest < self
|
50
|
+
class ReaderTest < self
|
51
|
+
def test_default
|
52
|
+
command = reference_acquire_command
|
53
|
+
assert do
|
54
|
+
command.recursive?
|
55
|
+
end
|
56
|
+
assert do
|
57
|
+
not command.recursive_dependent?
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_no
|
62
|
+
command = reference_acquire_command(:recursive => "no")
|
63
|
+
assert do
|
64
|
+
not command.recursive?
|
65
|
+
end
|
66
|
+
assert do
|
67
|
+
not command.recursive_dependent?
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_dependent
|
72
|
+
command = reference_acquire_command(:recursive => "dependent")
|
73
|
+
assert do
|
74
|
+
command.recursive?
|
75
|
+
end
|
76
|
+
assert do
|
77
|
+
command.recursive_dependent?
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Copyright (C) 2020 Sutou Kouhei <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
class ReferenceReleaseCommandTest < Test::Unit::TestCase
|
18
|
+
private
|
19
|
+
def reference_release_command(pair_arguments={}, ordered_arguments=[])
|
20
|
+
Groonga::Command::ReferenceRelease.new(pair_arguments,
|
21
|
+
ordered_arguments)
|
22
|
+
end
|
23
|
+
|
24
|
+
class ConstructorTest < self
|
25
|
+
def test_ordered_arguments
|
26
|
+
target_name = "Users"
|
27
|
+
recursive = "no"
|
28
|
+
|
29
|
+
ordered_arguments = [
|
30
|
+
target_name,
|
31
|
+
recursive,
|
32
|
+
]
|
33
|
+
command = reference_release_command({}, ordered_arguments)
|
34
|
+
assert_equal({
|
35
|
+
:target_name => target_name,
|
36
|
+
:recursive => recursive,
|
37
|
+
},
|
38
|
+
command.arguments)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class TargetNameTest < self
|
43
|
+
def test_reader
|
44
|
+
command = reference_release_command(:target_name => "Users")
|
45
|
+
assert_equal("Users", command.target_name)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class RecursiveTest < self
|
50
|
+
class ReaderTest < self
|
51
|
+
def test_default
|
52
|
+
command = reference_release_command
|
53
|
+
assert do
|
54
|
+
command.recursive?
|
55
|
+
end
|
56
|
+
assert do
|
57
|
+
not command.recursive_dependent?
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_no
|
62
|
+
command = reference_release_command(:recursive => "no")
|
63
|
+
assert do
|
64
|
+
not command.recursive?
|
65
|
+
end
|
66
|
+
assert do
|
67
|
+
not command.recursive_dependent?
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_dependent
|
72
|
+
command = reference_release_command(:recursive => "dependent")
|
73
|
+
assert do
|
74
|
+
command.recursive?
|
75
|
+
end
|
76
|
+
assert do
|
77
|
+
command.recursive_dependent?
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Copyright (C) 2021 Sutou Kouhei <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
class TableCreateSimilarCommandTest < Test::Unit::TestCase
|
18
|
+
private
|
19
|
+
def table_create_similar_command(pair_arguments={}, ordered_arguments=[])
|
20
|
+
Groonga::Command::TableCreateSimilar.new(pair_arguments,
|
21
|
+
ordered_arguments)
|
22
|
+
end
|
23
|
+
|
24
|
+
class ConstructorTest < self
|
25
|
+
def test_ordered_arguments
|
26
|
+
name = "UsersSimilar"
|
27
|
+
base_table = "Users"
|
28
|
+
|
29
|
+
ordered_arguments = [
|
30
|
+
name,
|
31
|
+
base_table,
|
32
|
+
]
|
33
|
+
command = table_create_similar_command({}, ordered_arguments)
|
34
|
+
assert_equal({
|
35
|
+
name: name,
|
36
|
+
base_table: base_table,
|
37
|
+
},
|
38
|
+
command.arguments)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class NameTest < self
|
43
|
+
def test_reader
|
44
|
+
command = table_create_similar_command({"name" => "UsersSimilar"})
|
45
|
+
assert_equal("UsersSimilar", command.name)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class BaseTableTest < self
|
50
|
+
def test_reader
|
51
|
+
command = table_create_similar_command({"base_table" => "Users"})
|
52
|
+
assert_equal("Users", command.base_table)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2020 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
|
@@ -30,6 +30,7 @@ class TableCreateCommandTest < Test::Unit::TestCase
|
|
30
30
|
default_tokenizer = "TokenBigram"
|
31
31
|
normalizer = "NormalizerAuto"
|
32
32
|
token_filters = "TokenFilterStopWord|TokenFilterStem"
|
33
|
+
path = "tables.users"
|
33
34
|
|
34
35
|
ordered_arguments = [
|
35
36
|
name,
|
@@ -39,6 +40,7 @@ class TableCreateCommandTest < Test::Unit::TestCase
|
|
39
40
|
default_tokenizer,
|
40
41
|
normalizer,
|
41
42
|
token_filters,
|
43
|
+
path,
|
42
44
|
]
|
43
45
|
command = table_create_command({}, ordered_arguments)
|
44
46
|
assert_equal({
|
@@ -49,6 +51,7 @@ class TableCreateCommandTest < Test::Unit::TestCase
|
|
49
51
|
:default_tokenizer => default_tokenizer,
|
50
52
|
:normalizer => normalizer,
|
51
53
|
:token_filters => token_filters,
|
54
|
+
:path => path,
|
52
55
|
},
|
53
56
|
command.arguments)
|
54
57
|
end
|
@@ -230,4 +233,16 @@ class TableCreateCommandTest < Test::Unit::TestCase
|
|
230
233
|
assert_equal([], command.token_filters)
|
231
234
|
end
|
232
235
|
end
|
236
|
+
|
237
|
+
class PathTest < self
|
238
|
+
def test_specified
|
239
|
+
command = table_create_command({"path" => "tables.users"})
|
240
|
+
assert_equal("tables.users", command.path)
|
241
|
+
end
|
242
|
+
|
243
|
+
def test_omitted
|
244
|
+
command = table_create_command
|
245
|
+
assert_nil(command.path)
|
246
|
+
end
|
247
|
+
end
|
233
248
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.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:
|
11
|
+
date: 2021-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -190,6 +190,8 @@ files:
|
|
190
190
|
- lib/groonga/command/query-log-flags-remove.rb
|
191
191
|
- lib/groonga/command/query-log-flags-set.rb
|
192
192
|
- lib/groonga/command/range-filter.rb
|
193
|
+
- lib/groonga/command/reference-acquire.rb
|
194
|
+
- lib/groonga/command/reference-release.rb
|
193
195
|
- lib/groonga/command/register.rb
|
194
196
|
- lib/groonga/command/reindex.rb
|
195
197
|
- lib/groonga/command/request-cancel.rb
|
@@ -203,6 +205,7 @@ files:
|
|
203
205
|
- lib/groonga/command/status.rb
|
204
206
|
- lib/groonga/command/suggest.rb
|
205
207
|
- lib/groonga/command/table-copy.rb
|
208
|
+
- lib/groonga/command/table-create-similar.rb
|
206
209
|
- lib/groonga/command/table-create.rb
|
207
210
|
- lib/groonga/command/table-list.rb
|
208
211
|
- lib/groonga/command/table-remove.rb
|
@@ -247,6 +250,8 @@ files:
|
|
247
250
|
- test/command/test-query-log-flags-remove.rb
|
248
251
|
- test/command/test-query-log-flags-set.rb
|
249
252
|
- test/command/test-range-filter.rb
|
253
|
+
- test/command/test-reference-acquire.rb
|
254
|
+
- test/command/test-reference-release.rb
|
250
255
|
- test/command/test-register.rb
|
251
256
|
- test/command/test-reindex.rb
|
252
257
|
- test/command/test-request-cancel.rb
|
@@ -258,6 +263,7 @@ files:
|
|
258
263
|
- test/command/test-status.rb
|
259
264
|
- test/command/test-suggest.rb
|
260
265
|
- test/command/test-table-copy.rb
|
266
|
+
- test/command/test-table-create-similar.rb
|
261
267
|
- test/command/test-table-create.rb
|
262
268
|
- test/command/test-table-list.rb
|
263
269
|
- test/command/test-table-remove.rb
|
@@ -287,66 +293,68 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
293
|
- !ruby/object:Gem::Version
|
288
294
|
version: '0'
|
289
295
|
requirements: []
|
290
|
-
|
291
|
-
rubygems_version: 2.7.6.2
|
296
|
+
rubygems_version: 3.3.0.dev
|
292
297
|
signing_key:
|
293
298
|
specification_version: 4
|
294
299
|
summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s
|
295
300
|
command. You can write a program that handle Groonga's command by using groonga-command.
|
296
301
|
test_files:
|
297
|
-
- test/
|
298
|
-
- test/command/test-
|
302
|
+
- test/command/format/test-command.rb
|
303
|
+
- test/command/test-base.rb
|
304
|
+
- test/command/test-column-copy.rb
|
305
|
+
- test/command/test-column-create.rb
|
306
|
+
- test/command/test-column-list.rb
|
307
|
+
- test/command/test-column-remove.rb
|
299
308
|
- test/command/test-column-rename.rb
|
300
|
-
- test/command/test-
|
309
|
+
- test/command/test-config-delete.rb
|
301
310
|
- test/command/test-config-get.rb
|
302
|
-
- test/command/test-
|
303
|
-
- test/command/test-
|
304
|
-
- test/command/test-
|
305
|
-
- test/command/
|
306
|
-
- test/command/test-
|
307
|
-
- test/command/test-
|
311
|
+
- test/command/test-config-set.rb
|
312
|
+
- test/command/test-delete.rb
|
313
|
+
- test/command/test-dump.rb
|
314
|
+
- test/command/test-get.rb
|
315
|
+
- test/command/test-index-column-diff.rb
|
316
|
+
- test/command/test-io-flush.rb
|
317
|
+
- test/command/test-load.rb
|
318
|
+
- test/command/test-log-level.rb
|
308
319
|
- test/command/test-log-put.rb
|
309
|
-
- test/command/test-
|
310
|
-
- test/command/test-query-log-flags-set.rb
|
320
|
+
- test/command/test-logical-count.rb
|
311
321
|
- test/command/test-logical-range-filter.rb
|
312
|
-
- test/command/test-column-list.rb
|
313
|
-
- test/command/test-ruby-load.rb
|
314
|
-
- test/command/test-query-log-flags-add.rb
|
315
|
-
- test/command/test-table-copy.rb
|
316
|
-
- test/command/test-config-delete.rb
|
317
322
|
- test/command/test-logical-select.rb
|
318
|
-
- test/command/test-tokenize.rb
|
319
|
-
- test/command/test-table-tokenize.rb
|
320
|
-
- test/command/test-request-cancel.rb
|
321
|
-
- test/command/test-column-copy.rb
|
322
|
-
- test/command/test-suggest.rb
|
323
|
-
- test/command/test-column-remove.rb
|
324
|
-
- test/command/test-object-remove.rb
|
325
323
|
- test/command/test-logical-shard-list.rb
|
326
|
-
- test/command/test-column-create.rb
|
327
|
-
- test/command/test-get.rb
|
328
|
-
- test/command/test-load.rb
|
329
|
-
- test/command/test-reindex.rb
|
330
|
-
- test/command/test-plugin-unregister.rb
|
331
|
-
- test/command/test-io-flush.rb
|
332
324
|
- test/command/test-logical-table-remove.rb
|
333
|
-
- test/command/test-
|
334
|
-
- test/command/test-
|
325
|
+
- test/command/test-normalize.rb
|
326
|
+
- test/command/test-object-exist.rb
|
335
327
|
- test/command/test-object-inspect.rb
|
336
|
-
- test/command/test-
|
328
|
+
- test/command/test-object-remove.rb
|
329
|
+
- test/command/test-plugin-register.rb
|
330
|
+
- test/command/test-plugin-unregister.rb
|
337
331
|
- test/command/test-query-expand.rb
|
338
|
-
- test/command/test-
|
339
|
-
- test/command/test-
|
340
|
-
- test/command/test-
|
341
|
-
- test/command/test-
|
342
|
-
- test/command/test-
|
343
|
-
- test/command/test-
|
332
|
+
- test/command/test-query-log-flags-add.rb
|
333
|
+
- test/command/test-query-log-flags-get.rb
|
334
|
+
- test/command/test-query-log-flags-remove.rb
|
335
|
+
- test/command/test-query-log-flags-set.rb
|
336
|
+
- test/command/test-range-filter.rb
|
337
|
+
- test/command/test-reference-acquire.rb
|
338
|
+
- test/command/test-reference-release.rb
|
339
|
+
- test/command/test-register.rb
|
340
|
+
- test/command/test-reindex.rb
|
341
|
+
- test/command/test-request-cancel.rb
|
344
342
|
- test/command/test-ruby-eval.rb
|
343
|
+
- test/command/test-ruby-load.rb
|
345
344
|
- test/command/test-schema.rb
|
346
|
-
- test/command/test-normalize.rb
|
347
|
-
- test/command/test-dump.rb
|
348
|
-
- test/command/test-base.rb
|
349
|
-
- test/command/test-logical-count.rb
|
350
|
-
- test/command/test-table-remove.rb
|
351
345
|
- test/command/test-select.rb
|
346
|
+
- test/command/test-shutdown.rb
|
347
|
+
- test/command/test-status.rb
|
348
|
+
- test/command/test-suggest.rb
|
349
|
+
- test/command/test-table-copy.rb
|
350
|
+
- test/command/test-table-create-similar.rb
|
351
|
+
- test/command/test-table-create.rb
|
352
|
+
- test/command/test-table-list.rb
|
353
|
+
- test/command/test-table-remove.rb
|
354
|
+
- test/command/test-table-rename.rb
|
355
|
+
- test/command/test-table-tokenize.rb
|
356
|
+
- test/command/test-thread-limit.rb
|
357
|
+
- test/command/test-tokenize.rb
|
358
|
+
- test/command/test-truncate.rb
|
352
359
|
- test/groonga-command-test-utils.rb
|
360
|
+
- test/run-test.rb
|