groonga-command 1.5.1 → 1.5.3

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: 1d6cee09a163fa437fa60d3bb047050ed3941cafc0ed14b8c92a3a7c3ae74fc7
4
+ data.tar.gz: '07080bc6670a7efc38ab3994e6a50b15b6b6afee577512dc8e68a11fe2b3bdc9'
5
5
  SHA512:
6
- metadata.gz: 4a208143568256aa7b498f769e414c5a99677b08884fdb23e2338d2749764ae14a5555ce948ce96269c582fadab0320633f10377b2023f45eaf8960a2d84c083
7
- data.tar.gz: 3df454e758a385b3cf85033f3fab4d34aef5592204abeae71ebcda8a12e54d2ed385545658795b2f5a30104d021fd4123ca8ab9cce7c6e28b4d4b536f170b485
6
+ metadata.gz: 77e84ebb13f94d20f8a4c492b91d35ac90d633b151838817f05b5af9902ca606014eec13100eec91cff83f2d3102fd3916f8098db08942ad4486c52d80545b98
7
+ data.tar.gz: 8fae0696d8f630977664644c17002c0756c7df5b8e01fd98e0a4e62af6ce49138dccd1e2af1464b86e21eccc319360461b07130672926661e69ef192af171fda
data/doc/text/news.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # News
2
2
 
3
+ ## 1.5.3: 2023-11-07
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::Load}: Added support for `Arrow::Table` as values.
8
+
9
+ * {Groonga::Command::Base}: Added support for `output_trace_log`.
10
+
11
+ ## 1.5.2: 2021-08-25
12
+
13
+ ### Improvements
14
+
15
+ * {Groonga::Command::ColumnCreateSimilar}: Added.
16
+
3
17
  ## 1.5.1: 2021-08-24
4
18
 
5
19
  ### Improvements
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
3
+ # Copyright (C) 2012-2023 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
@@ -60,7 +60,6 @@ Gem::Specification.new do |spec|
60
60
  spec.add_development_dependency("red-arrow")
61
61
  spec.add_development_dependency("redcarpet")
62
62
  spec.add_development_dependency("test-unit")
63
- spec.add_development_dependency("test-unit-notify")
64
63
  spec.add_development_dependency("yard")
65
64
  end
66
65
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2019 Sutou Kouhei <kou@clear-code.com>
1
+ # Copyright (C) 2012-2023 Sutou Kouhei <kou@clear-code.com>
2
2
  # Copyright (C) 2019 Yasuhiro Horimoto <horimoto@clear-code.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
@@ -146,6 +146,13 @@ module Groonga
146
146
  self[:request_id]
147
147
  end
148
148
 
149
+ # @return [Boolean] `output_trace_log` parameter value.
150
+ #
151
+ # @since 1.5.3
152
+ def output_trace_log?
153
+ boolean_value(:output_trace_log, default: false, invalid: false)
154
+ end
155
+
149
156
  def to_uri_format
150
157
  Format::URI.new(@path_prefix, @command_name, normalized_arguments).path
151
158
  end
@@ -241,9 +248,9 @@ module Groonga
241
248
  value = value.strip
242
249
  return default if value.empty?
243
250
  case value
244
- when "yes"
251
+ when "yes", "true"
245
252
  true
246
- when "no"
253
+ when "no", "false"
247
254
  false
248
255
  else
249
256
  invalid
@@ -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
@@ -84,6 +84,7 @@ module Groonga
84
84
  unless defined?(::Arrow)
85
85
  raise NotImplementedError, "red-arrow is required"
86
86
  end
87
+ return self[:values] if self[:values].is_a?(::Arrow::Table)
87
88
  source_lines = (original_source || "").lines
88
89
  if source_lines.size >= 2
89
90
  if /\s--columns\s/ =~ source_lines.first
@@ -112,6 +113,7 @@ module Groonga
112
113
  private
113
114
  def parse_values(values)
114
115
  return values if values.nil?
116
+ return values if defined?(::Arrow) and values.is_a?(::Arrow::Table)
115
117
  JSON.parse(values)
116
118
  end
117
119
 
@@ -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.3"
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"
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2011-2017 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2011-2023 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
@@ -375,4 +375,21 @@ select \\
375
375
  assert_equal(:xml, command.output_type)
376
376
  end
377
377
  end
378
+
379
+ sub_test_case("#output_trace_log?") do
380
+ def test_default
381
+ command = Groonga::Command::Base.new("table_list", {})
382
+ assert do
383
+ not command.output_trace_log?
384
+ end
385
+ end
386
+
387
+ def test_specified
388
+ command = Groonga::Command::Base.new("table_list",
389
+ output_trace_log: "yes")
390
+ assert do
391
+ command.output_trace_log?
392
+ end
393
+ end
394
+ end
378
395
  end
@@ -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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2016-2023 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
@@ -43,9 +43,14 @@ class ObjectRemoveCommandTest < Test::Unit::TestCase
43
43
  end
44
44
 
45
45
  class ForceTest < self
46
- def test_reader
46
+ def test_reader_yes
47
47
  command = object_remove_command(:force => "yes")
48
48
  assert_true(command.force?)
49
49
  end
50
+
51
+ def test_reader_true
52
+ command = object_remove_command(force: "true")
53
+ assert_true(command.force?)
54
+ end
50
55
  end
51
56
  end
data/test/run-test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2012-2023 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
@@ -24,8 +24,7 @@ base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
24
24
  lib_dir = File.join(base_dir, "lib")
25
25
  test_dir = File.join(base_dir, "test")
26
26
 
27
- require "test-unit"
28
- require "test/unit/notify"
27
+ require "test/unit"
29
28
 
30
29
  Test::Unit::Priority.enable
31
30
 
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-24 00:00:00.000000000 Z
11
+ date: 2023-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -108,20 +108,6 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: test-unit-notify
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
111
  - !ruby/object:Gem::Dependency
126
112
  name: yard
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -153,6 +139,7 @@ files:
153
139
  - lib/groonga/command.rb
154
140
  - lib/groonga/command/base.rb
155
141
  - lib/groonga/command/column-copy.rb
142
+ - lib/groonga/command/column-create-similar.rb
156
143
  - lib/groonga/command/column-create.rb
157
144
  - lib/groonga/command/column-list.rb
158
145
  - lib/groonga/command/column-remove.rb
@@ -218,6 +205,7 @@ files:
218
205
  - test/command/format/test-command.rb
219
206
  - test/command/test-base.rb
220
207
  - test/command/test-column-copy.rb
208
+ - test/command/test-column-create-similar.rb
221
209
  - test/command/test-column-create.rb
222
210
  - test/command/test-column-list.rb
223
211
  - test/command/test-column-remove.rb
@@ -278,7 +266,7 @@ homepage: https://github.com/groonga/groonga-command
278
266
  licenses:
279
267
  - LGPLv2.1+
280
268
  metadata: {}
281
- post_install_message:
269
+ post_install_message:
282
270
  rdoc_options: []
283
271
  require_paths:
284
272
  - lib
@@ -293,8 +281,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
281
  - !ruby/object:Gem::Version
294
282
  version: '0'
295
283
  requirements: []
296
- rubygems_version: 3.3.0.dev
297
- signing_key:
284
+ rubygems_version: 3.5.0.dev
285
+ signing_key:
298
286
  specification_version: 4
299
287
  summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s
300
288
  command. You can write a program that handle Groonga's command by using groonga-command.
@@ -302,6 +290,7 @@ test_files:
302
290
  - test/command/format/test-command.rb
303
291
  - test/command/test-base.rb
304
292
  - test/command/test-column-copy.rb
293
+ - test/command/test-column-create-similar.rb
305
294
  - test/command/test-column-create.rb
306
295
  - test/command/test-column-list.rb
307
296
  - test/command/test-column-remove.rb