groonga-command 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47d6a7b2852bae83978ea53afb8cf161900a1d966a858c097b5abe73e1be352e
4
- data.tar.gz: 3713f2fd40276e7ac46947792a8aeda9a3c673a9cb02a89883525c1a2c66d663
3
+ metadata.gz: 1cf6a57f9110c2d5d3367cff7c2d787e4ef439a067428a276c4f7fc1894797a2
4
+ data.tar.gz: b0c455cbf9b6f90d6f92a4323a29ccdc3b63e06ebeb7712b2cdaf6cb51d25139
5
5
  SHA512:
6
- metadata.gz: 4a208143568256aa7b498f769e414c5a99677b08884fdb23e2338d2749764ae14a5555ce948ce96269c582fadab0320633f10377b2023f45eaf8960a2d84c083
7
- data.tar.gz: 3df454e758a385b3cf85033f3fab4d34aef5592204abeae71ebcda8a12e54d2ed385545658795b2f5a30104d021fd4123ca8ab9cce7c6e28b4d4b536f170b485
6
+ metadata.gz: 6cd5e31a78862c2c934041de95e3a34be83d4db7caba059fbc0d10cb579c978d3f430abf845f239d0cc24d898c202ef22c1f6331ccb1141de3556a31a22c9d45
7
+ data.tar.gz: c811309bb82936ed586847ed631e5efff2398ca9b10f2b9cb2d849fc6bfb385bf4d463d139bc71de0be4fd964da36608266f887d1c7d1076387db0a4cc77cb86
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.5.2: 2021-08-25
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::ColumnCreateSimilar}: Added.
8
+
3
9
  ## 1.5.1: 2021-08-24
4
10
 
5
11
  ### Improvements
@@ -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
@@ -40,6 +40,7 @@ module Groonga
40
40
  def name
41
41
  self[:name]
42
42
  end
43
+
43
44
  # @return [String] The base table name.
44
45
  #
45
46
  # @since 1.5.1
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
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.1"
19
+ VERSION = "1.5.2"
20
20
  end
21
21
  end
@@ -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.1
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-24 00:00:00.000000000 Z
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