groonga-command 1.5.1 → 1.5.2
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 +4 -4
- data/doc/text/news.md +6 -0
- data/lib/groonga/command/column-create-similar.rb +60 -0
- data/lib/groonga/command/table-create-similar.rb +1 -0
- data/lib/groonga/command/version.rb +2 -2
- data/lib/groonga/command.rb +1 -0
- data/test/command/test-column-create-similar.rb +65 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cf6a57f9110c2d5d3367cff7c2d787e4ef439a067428a276c4f7fc1894797a2
|
4
|
+
data.tar.gz: b0c455cbf9b6f90d6f92a4323a29ccdc3b63e06ebeb7712b2cdaf6cb51d25139
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd5e31a78862c2c934041de95e3a34be83d4db7caba059fbc0d10cb579c978d3f430abf845f239d0cc24d898c202ef22c1f6331ccb1141de3556a31a22c9d45
|
7
|
+
data.tar.gz: c811309bb82936ed586847ed631e5efff2398ca9b10f2b9cb2d849fc6bfb385bf4d463d139bc71de0be4fd964da36608266f887d1c7d1076387db0a4cc77cb86
|
data/doc/text/news.md
CHANGED
@@ -0,0 +1,60 @@
|
|
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 ColumnCreateSimilar < Base
|
22
|
+
class << self
|
23
|
+
def command_name
|
24
|
+
"column_create_similar"
|
25
|
+
end
|
26
|
+
|
27
|
+
def parameter_names
|
28
|
+
[
|
29
|
+
:table,
|
30
|
+
:name,
|
31
|
+
:base_column,
|
32
|
+
]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
Command.register(command_name, self)
|
37
|
+
|
38
|
+
# @return [String] table name.
|
39
|
+
#
|
40
|
+
# @since 1.5.2
|
41
|
+
def table
|
42
|
+
self[:table]
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [String] The column name.
|
46
|
+
#
|
47
|
+
# @since 1.5.2
|
48
|
+
def name
|
49
|
+
self[:name]
|
50
|
+
end
|
51
|
+
|
52
|
+
# @return [String] The base column name.
|
53
|
+
#
|
54
|
+
# @since 1.5.2
|
55
|
+
def base_column
|
56
|
+
self[:base_column]
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -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
|
@@ -16,6 +16,6 @@
|
|
16
16
|
|
17
17
|
module Groonga
|
18
18
|
module Command
|
19
|
-
VERSION = "1.5.
|
19
|
+
VERSION = "1.5.2"
|
20
20
|
end
|
21
21
|
end
|
data/lib/groonga/command.rb
CHANGED
@@ -20,6 +20,7 @@ require "groonga/command/error"
|
|
20
20
|
|
21
21
|
require "groonga/command/column-copy"
|
22
22
|
require "groonga/command/column-create"
|
23
|
+
require "groonga/command/column-create-similar"
|
23
24
|
require "groonga/command/column-list"
|
24
25
|
require "groonga/command/column-remove"
|
25
26
|
require "groonga/command/column-rename"
|
@@ -0,0 +1,65 @@
|
|
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 ColumnCreateSimilarCommandTest < Test::Unit::TestCase
|
18
|
+
private
|
19
|
+
def column_create_similar_command(pair_arguments={}, ordered_arguments=[])
|
20
|
+
Groonga::Command::ColumnCreateSimilar.new(pair_arguments,
|
21
|
+
ordered_arguments)
|
22
|
+
end
|
23
|
+
|
24
|
+
class ConstructorTest < self
|
25
|
+
def test_ordered_arguments
|
26
|
+
table = "LexiconSimilar"
|
27
|
+
name = "content_index"
|
28
|
+
base_column = "Lexicon.content_index"
|
29
|
+
|
30
|
+
command = column_create_similar_command({},
|
31
|
+
[
|
32
|
+
table,
|
33
|
+
name,
|
34
|
+
base_column,
|
35
|
+
])
|
36
|
+
assert_equal({
|
37
|
+
table: table,
|
38
|
+
name: name,
|
39
|
+
base_column: base_column,
|
40
|
+
},
|
41
|
+
command.arguments)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class TableTest < self
|
46
|
+
def test_reader
|
47
|
+
command = column_create_similar_command({"table" => "LogsSimilar"})
|
48
|
+
assert_equal("LogsSimilar", command.table)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class NameTest < self
|
53
|
+
def test_reader
|
54
|
+
command = column_create_similar_command({"name" => "message"})
|
55
|
+
assert_equal("message", command.name)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class BaseColumnTest < self
|
60
|
+
def test_reader
|
61
|
+
command = column_create_similar_command({"base_column" => "Logs.message"})
|
62
|
+
assert_equal("Logs.message", command.base_column)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
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.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/groonga/command.rb
|
154
154
|
- lib/groonga/command/base.rb
|
155
155
|
- lib/groonga/command/column-copy.rb
|
156
|
+
- lib/groonga/command/column-create-similar.rb
|
156
157
|
- lib/groonga/command/column-create.rb
|
157
158
|
- lib/groonga/command/column-list.rb
|
158
159
|
- lib/groonga/command/column-remove.rb
|
@@ -218,6 +219,7 @@ files:
|
|
218
219
|
- test/command/format/test-command.rb
|
219
220
|
- test/command/test-base.rb
|
220
221
|
- test/command/test-column-copy.rb
|
222
|
+
- test/command/test-column-create-similar.rb
|
221
223
|
- test/command/test-column-create.rb
|
222
224
|
- test/command/test-column-list.rb
|
223
225
|
- test/command/test-column-remove.rb
|
@@ -302,6 +304,7 @@ test_files:
|
|
302
304
|
- test/command/format/test-command.rb
|
303
305
|
- test/command/test-base.rb
|
304
306
|
- test/command/test-column-copy.rb
|
307
|
+
- test/command/test-column-create-similar.rb
|
305
308
|
- test/command/test-column-create.rb
|
306
309
|
- test/command/test-column-list.rb
|
307
310
|
- test/command/test-column-remove.rb
|