groonga-command 1.5.0 → 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 +6 -0
- data/lib/groonga/command/table-create-similar.rb +51 -0
- data/lib/groonga/command/version.rb +1 -1
- data/lib/groonga/command.rb +2 -1
- data/test/command/test-table-create-similar.rb +55 -0
- metadata +6 -3
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
@@ -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
|
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
|
@@ -65,6 +65,7 @@ require "groonga/command/status"
|
|
65
65
|
require "groonga/command/suggest"
|
66
66
|
require "groonga/command/table-copy"
|
67
67
|
require "groonga/command/table-create"
|
68
|
+
require "groonga/command/table-create-similar"
|
68
69
|
require "groonga/command/table-list"
|
69
70
|
require "groonga/command/table-remove"
|
70
71
|
require "groonga/command/table-rename"
|
@@ -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
|
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.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
|
@@ -205,6 +205,7 @@ files:
|
|
205
205
|
- lib/groonga/command/status.rb
|
206
206
|
- lib/groonga/command/suggest.rb
|
207
207
|
- lib/groonga/command/table-copy.rb
|
208
|
+
- lib/groonga/command/table-create-similar.rb
|
208
209
|
- lib/groonga/command/table-create.rb
|
209
210
|
- lib/groonga/command/table-list.rb
|
210
211
|
- lib/groonga/command/table-remove.rb
|
@@ -262,6 +263,7 @@ files:
|
|
262
263
|
- test/command/test-status.rb
|
263
264
|
- test/command/test-suggest.rb
|
264
265
|
- test/command/test-table-copy.rb
|
266
|
+
- test/command/test-table-create-similar.rb
|
265
267
|
- test/command/test-table-create.rb
|
266
268
|
- test/command/test-table-list.rb
|
267
269
|
- test/command/test-table-remove.rb
|
@@ -291,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
293
|
- !ruby/object:Gem::Version
|
292
294
|
version: '0'
|
293
295
|
requirements: []
|
294
|
-
rubygems_version: 3.
|
296
|
+
rubygems_version: 3.3.0.dev
|
295
297
|
signing_key:
|
296
298
|
specification_version: 4
|
297
299
|
summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s
|
@@ -345,6 +347,7 @@ test_files:
|
|
345
347
|
- test/command/test-status.rb
|
346
348
|
- test/command/test-suggest.rb
|
347
349
|
- test/command/test-table-copy.rb
|
350
|
+
- test/command/test-table-create-similar.rb
|
348
351
|
- test/command/test-table-create.rb
|
349
352
|
- test/command/test-table-list.rb
|
350
353
|
- test/command/test-table-remove.rb
|