groonga-command 1.4.1 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 90745a99d72f93d9d719234502ba3647dcb1925c
4
- data.tar.gz: ae6c07674439ffecdccacb23a24522dc342859d5
2
+ SHA256:
3
+ metadata.gz: 4d2f555370a8c3bba2991a68593c7bb398054a23e4445d46ec29dbaf2b875762
4
+ data.tar.gz: f4e599c46ff4e418539b10f6e6171eb28dbcceda8c59156e2afb296b4d0b50c7
5
5
  SHA512:
6
- metadata.gz: bcc65e519bb8f64dfc51dd8b71d4070bcefd3a7a730c2bf96c161d953a9a7da5d5e05b475fbcc8dfca3c2a3f6ee1980455ebccb1aefd1e44d9c21bcb267c41c8
7
- data.tar.gz: fad54dfbfe207833888e7d7681c9fa9a2109c20aef29cbf602984b048b082e57ef4079e0add7c051755727cbb1165b3e26a4c9b7f77b4fe3d47c5e76fe537fbf
6
+ metadata.gz: 342c12272bb17b82cfa81070f87a13e0fbec393aa925feed32788c3d8702f50f033cdcc9ac06c8720edfc691fe8d50d98f013279268de20fa7415d1ecbff1dd6
7
+ data.tar.gz: 11b5f90f786a5e9ed636ed88f623f7042a15c37c3c92f20f708534213037f82f5dc52814763d0a2d4930f106801bc658839eca754114809e34f574e45ee3ecaa
data/doc/text/news.md CHANGED
@@ -1,12 +1,22 @@
1
1
  # News
2
2
 
3
+ ## 1.4.2: 2019-08-21
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::LogicalSelect#sort_keys}: Added.
8
+
9
+ ### Fixes
10
+
11
+ * Fixed a bug that Command::Base#== uses name instead of command_name [GitHub#13][Reported by yagisumi]
12
+
3
13
  ## 1.4.1: 2019-03-26
4
14
 
5
15
  ### Fixes
6
16
 
7
17
  * Fixed a bug that result of conversion to the Elasticsearch
8
18
  format result is wrong
9
-
19
+
10
20
  ## 1.4.0: 2019-03-20
11
21
 
12
22
  ### Improvements
@@ -14,7 +24,7 @@
14
24
  * {Groonga::Command::Format::Elasticsearch}: Added.
15
25
 
16
26
  * {Groonga::Command::Base#to_elasticsearch_format}: Added.
17
-
27
+
18
28
  ## 1.3.9: 2019-03-19
19
29
 
20
30
  ### Improvements
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2019 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
@@ -123,7 +123,7 @@ module Groonga
123
123
 
124
124
  def ==(other)
125
125
  other.is_a?(self.class) and
126
- @command_name == other.name and
126
+ @command_name == other.command_name and
127
127
  @arguments == other.arguments
128
128
  end
129
129
 
@@ -50,6 +50,7 @@ module Groonga
50
50
  :drilldown_limit,
51
51
  :drilldown_calc_types,
52
52
  :drilldown_calc_target,
53
+ :sort_keys,
53
54
  ]
54
55
  end
55
56
  end
@@ -188,6 +189,13 @@ module Groonga
188
189
  def drilldown_calc_target
189
190
  self[:drilldown_calc_target]
190
191
  end
192
+
193
+ # @return [::Array<String>] The sort keys.
194
+ #
195
+ # @since 1.4.2
196
+ def sort_keys
197
+ parse_array_value(self[:sort_keys] || self[:sortby] || "")
198
+ end
191
199
  end
192
200
  end
193
201
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Groonga
18
18
  module Command
19
- VERSION = "1.4.1"
19
+ VERSION = "1.4.2"
20
20
  end
21
21
  end
@@ -41,6 +41,7 @@ class LogicalSelectCommandTest < Test::Unit::TestCase
41
41
  drilldown_limit = "10"
42
42
  drilldown_calc_types = "MIN,AVG"
43
43
  drilldown_calc_target = "n_occurred"
44
+ sort_keys = "-_score"
44
45
 
45
46
  ordered_arguments = [
46
47
  logical_table,
@@ -61,6 +62,7 @@ class LogicalSelectCommandTest < Test::Unit::TestCase
61
62
  drilldown_limit,
62
63
  drilldown_calc_types,
63
64
  drilldown_calc_target,
65
+ sort_keys,
64
66
  ]
65
67
  command = logical_select_command({}, ordered_arguments)
66
68
  assert_equal({
@@ -82,6 +84,7 @@ class LogicalSelectCommandTest < Test::Unit::TestCase
82
84
  :drilldown_limit => drilldown_limit,
83
85
  :drilldown_calc_types => drilldown_calc_types,
84
86
  :drilldown_calc_target => drilldown_calc_target,
87
+ :sort_keys => sort_keys,
85
88
  },
86
89
  command.arguments)
87
90
  end
@@ -205,4 +208,11 @@ class LogicalSelectCommandTest < Test::Unit::TestCase
205
208
  assert_equal("n_occurred", command.drilldown_calc_target)
206
209
  end
207
210
  end
211
+
212
+ class SortKeysTest < self
213
+ def test_reader
214
+ command = logical_select_command(:sort_keys => "-_score, _key")
215
+ assert_equal(["-_score", "_key"], command.sort_keys)
216
+ end
217
+ end
208
218
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2015-2019 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
@@ -42,4 +42,22 @@ class PluginUnregisterCommandTest < Test::Unit::TestCase
42
42
  assert_equal("query_expanders/tsv", command.name)
43
43
  end
44
44
  end
45
+
46
+ class EqualTest < self
47
+ def test_equal
48
+ command1 = plugin_unregister_command(:name => "query_expanders/tsv")
49
+ command2 = plugin_unregister_command(:name => "query_expanders/tsv")
50
+ assert do
51
+ command1 == command2
52
+ end
53
+ end
54
+
55
+ def test_not_equal
56
+ command1 = plugin_unregister_command(:name => "query_expanders/tsv")
57
+ command2 = plugin_unregister_command(:name => "functions/vector")
58
+ assert do
59
+ command1 != command2
60
+ end
61
+ end
62
+ end
45
63
  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.1
4
+ version: 1.4.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: 2019-03-26 00:00:00.000000000 Z
11
+ date: 2019-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -271,66 +271,65 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  requirements: []
274
- rubyforge_project:
275
- rubygems_version: 2.5.2.1
274
+ rubygems_version: 3.0.3
276
275
  signing_key:
277
276
  specification_version: 4
278
277
  summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s
279
278
  command. You can write a program that handle Groonga's command by using groonga-command.
280
279
  test_files:
281
280
  - test/run-test.rb
282
- - test/groonga-command-test-utils.rb
283
- - test/command/test-query-log-flags-add.rb
284
- - test/command/test-log-put.rb
285
- - test/command/test-column-create.rb
286
- - test/command/test-config-get.rb
287
- - test/command/test-logical-select.rb
288
- - test/command/test-plugin-register.rb
289
- - test/command/test-io-flush.rb
290
- - test/command/test-column-remove.rb
291
- - test/command/test-query-expand.rb
292
- - test/command/test-logical-count.rb
293
- - test/command/test-log-level.rb
294
- - test/command/test-shutdown.rb
295
- - test/command/test-column-copy.rb
296
- - test/command/test-suggest.rb
297
- - test/command/test-get.rb
298
- - test/command/test-index-column-diff.rb
299
- - test/command/test-logical-shard-list.rb
300
- - test/command/test-table-create.rb
301
281
  - test/command/test-logical-table-remove.rb
302
- - test/command/test-query-log-flags-get.rb
282
+ - test/command/test-reindex.rb
283
+ - test/command/test-column-rename.rb
303
284
  - test/command/test-query-log-flags-set.rb
304
- - test/command/test-plugin-unregister.rb
305
- - test/command/test-delete.rb
285
+ - test/command/test-normalize.rb
286
+ - test/command/test-request-cancel.rb
287
+ - test/command/test-query-log-flags-get.rb
288
+ - test/command/test-range-filter.rb
289
+ - test/command/test-log-level.rb
290
+ - test/command/test-table-tokenize.rb
291
+ - test/command/test-logical-select.rb
292
+ - test/command/test-column-list.rb
306
293
  - test/command/test-status.rb
294
+ - test/command/test-load.rb
295
+ - test/command/test-table-remove.rb
296
+ - test/command/test-index-column-diff.rb
297
+ - test/command/test-suggest.rb
298
+ - test/command/test-delete.rb
307
299
  - test/command/test-logical-range-filter.rb
308
- - test/command/test-column-list.rb
300
+ - test/command/test-column-copy.rb
301
+ - test/command/test-base.rb
302
+ - test/command/test-table-create.rb
303
+ - test/command/test-table-list.rb
304
+ - test/command/test-select.rb
305
+ - test/command/test-query-log-flags-add.rb
309
306
  - test/command/test-config-delete.rb
310
- - test/command/test-dump.rb
307
+ - test/command/test-get.rb
308
+ - test/command/test-plugin-register.rb
309
+ - test/command/test-config-get.rb
311
310
  - test/command/format/test-command.rb
312
- - test/command/test-tokenize.rb
313
- - test/command/test-table-tokenize.rb
314
- - test/command/test-table-rename.rb
315
- - test/command/test-object-remove.rb
316
- - test/command/test-range-filter.rb
317
- - test/command/test-table-copy.rb
311
+ - test/command/test-shutdown.rb
312
+ - test/command/test-io-flush.rb
313
+ - test/command/test-query-expand.rb
314
+ - test/command/test-logical-shard-list.rb
315
+ - test/command/test-log-put.rb
318
316
  - test/command/test-query-log-flags-remove.rb
319
- - test/command/test-column-rename.rb
320
- - test/command/test-config-set.rb
317
+ - test/command/test-object-remove.rb
318
+ - test/command/test-logical-count.rb
321
319
  - test/command/test-thread-limit.rb
322
- - test/command/test-select.rb
323
- - test/command/test-reindex.rb
324
- - test/command/test-schema.rb
325
- - test/command/test-truncate.rb
326
- - test/command/test-ruby-eval.rb
320
+ - test/command/test-column-remove.rb
321
+ - test/command/test-table-copy.rb
327
322
  - test/command/test-ruby-load.rb
328
- - test/command/test-request-cancel.rb
329
- - test/command/test-table-list.rb
330
- - test/command/test-load.rb
331
323
  - test/command/test-object-inspect.rb
332
- - test/command/test-register.rb
333
- - test/command/test-base.rb
324
+ - test/command/test-plugin-unregister.rb
325
+ - test/command/test-table-rename.rb
326
+ - test/command/test-truncate.rb
327
+ - test/command/test-tokenize.rb
328
+ - test/command/test-config-set.rb
334
329
  - test/command/test-object-exist.rb
335
- - test/command/test-normalize.rb
336
- - test/command/test-table-remove.rb
330
+ - test/command/test-ruby-eval.rb
331
+ - test/command/test-register.rb
332
+ - test/command/test-dump.rb
333
+ - test/command/test-column-create.rb
334
+ - test/command/test-schema.rb
335
+ - test/groonga-command-test-utils.rb