groonga-command 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fd064a51b4d30a9e01f074b9a716cf38044e723a
4
+ data.tar.gz: 7ea59d11a39b99e03ac19649007605d6e6f36150
5
+ SHA512:
6
+ metadata.gz: 246c7bbef1f92f27bfb8f0d9d66004b79d78120fd0ec75daa2c02d4fd2bd4ed7bb0dc6e68beed4e73dadc840dcb464750c2e3ca3ec3524d97ea5389a2f8bdf2b
7
+ data.tar.gz: 98ca09fb709fdafa3ded9025aee35f62bc71464c73b3b740845583c9053cfd367c1e3d06106aa0554f58b7e560f9eab40cb5561ac650da8220a1c0609a99747f
data/doc/text/news.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # News
2
2
 
3
+ ## 1.0.7: 2014-03-15
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::ColumnCreate#sources}: Added.
8
+ * {Groonga::Command::ColumnCreate#table}: Added.
9
+ * {Groonga::Command::ColumnCreate#type}: Added.
10
+ * {Groonga::Command::TableCreate#key_type}: Added.
11
+ * {Groonga::Command::TableCreate#default_tokenizer}: Added.
12
+ * {Groonga::Command::TableCreate#normalizer}: Added.
13
+
3
14
  ## 1.0.6: 2013-10-29
4
15
 
5
16
  ### Improvements
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2012-2014 Kouhei Sutou <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
@@ -35,10 +35,22 @@ module Groonga
35
35
  end
36
36
  end
37
37
 
38
+ # @return [String] table name.
39
+ # @since 1.0.7
40
+ def table
41
+ self[:table]
42
+ end
43
+
38
44
  def flags
39
45
  @flags ||= (self[:flags] || "").split(/\s*\|\s*/)
40
46
  end
41
47
 
48
+ # @return [String] value type name of the column.
49
+ # @since 1.0.7
50
+ def type
51
+ self[:type]
52
+ end
53
+
42
54
  # @return [Boolean] true if "COLUMN_SCALAR" is specified in {#flags},
43
55
  # false otherwise.
44
56
  # @since 1.0.3
@@ -80,6 +92,13 @@ module Groonga
80
92
  def with_position?
81
93
  flags.include?("WITH_POSITION")
82
94
  end
95
+
96
+ # @return [::Array<String>] an array of index sources. If {#source} is
97
+ # empty or nil, this method returns an empty array.
98
+ # @since 1.0.7
99
+ def sources
100
+ @sources ||= (self[:source] || "").split(/\s*,\s*/)
101
+ end
83
102
  end
84
103
  end
85
104
  end
@@ -36,6 +36,12 @@ module Groonga
36
36
  end
37
37
  end
38
38
 
39
+ # @return [String, nil] Key type name, nil for array no key table.
40
+ # @since 1.0.7
41
+ def key_type
42
+ self[:key_type]
43
+ end
44
+
39
45
  def flags
40
46
  @flags ||= (self[:flags] || "").split(/\s*\|\s*/)
41
47
  end
@@ -74,6 +80,18 @@ module Groonga
74
80
  def key_with_sis?
75
81
  flags.include?("KEY_WITH_SIS")
76
82
  end
83
+
84
+ # @return [String, nil] Default tokenizer name or nil.
85
+ # @since 1.0.7
86
+ def default_tokenizer
87
+ self[:default_tokenizer]
88
+ end
89
+
90
+ # @return [String, nil] Normalizer name or nil.
91
+ # @since 1.0.7
92
+ def normalizer
93
+ self[:normalizer]
94
+ end
77
95
  end
78
96
  end
79
97
  end
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Groonga
20
20
  module Command
21
- VERSION = "1.0.6"
21
+ VERSION = "1.0.7"
22
22
  end
23
23
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2012-213 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2012-2014 Kouhei Sutou <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
@@ -44,6 +44,14 @@ class ColumnCreateCommandTest < Test::Unit::TestCase
44
44
  end
45
45
  end
46
46
 
47
+ class TableTest < self
48
+ def test_reader
49
+ command = column_create_command({"table" => "Logs"})
50
+ assert_equal("Logs",
51
+ command.table)
52
+ end
53
+ end
54
+
47
55
  class FlagsTest < self
48
56
  def test_multiple
49
57
  command = column_create_command({"flags" => "COLUMN_INDEX|WITH_POSITION"})
@@ -154,4 +162,35 @@ class ColumnCreateCommandTest < Test::Unit::TestCase
154
162
  end
155
163
  end
156
164
  end
165
+
166
+ class TypeTest < self
167
+ def test_reader
168
+ command = column_create_command({"type" => "ShortText"})
169
+ assert_equal("ShortText",
170
+ command.type)
171
+ end
172
+ end
173
+
174
+ class SourcesTest < self
175
+ def test_no_source
176
+ command = column_create_command
177
+ assert_equal([], command.sources)
178
+ end
179
+
180
+ def test_empty
181
+ command = column_create_command("source" => "")
182
+ assert_equal([], command.sources)
183
+ end
184
+
185
+ def test_one
186
+ command = column_create_command("source" => "title")
187
+ assert_equal(["title"], command.sources)
188
+ end
189
+
190
+ def test_multiple
191
+ command = column_create_command("source" => "title, text, comment")
192
+ assert_equal(["title", "text", "comment"],
193
+ command.sources)
194
+ end
195
+ end
157
196
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2012-2014 Kouhei Sutou <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
@@ -54,6 +54,18 @@ class TableCreateCommandTest < Test::Unit::TestCase
54
54
  end
55
55
  end
56
56
 
57
+ class KeyTypeTest < self
58
+ def test_specified
59
+ command = table_create_command({"key_type" => "ShortText"})
60
+ assert_equal("ShortText", command.key_type)
61
+ end
62
+
63
+ def test_omitted
64
+ command = table_create_command
65
+ assert_nil(command.key_type)
66
+ end
67
+ end
68
+
57
69
  class FlagsTest < self
58
70
  def test_multiple
59
71
  command = table_create_command({"flags" => "TABLE_PAT_KEY|KEY_WITH_SIS"})
@@ -149,4 +161,28 @@ class TableCreateCommandTest < Test::Unit::TestCase
149
161
  end
150
162
  end
151
163
  end
164
+
165
+ class DefaultTokenizerTest < self
166
+ def test_specified
167
+ command = table_create_command({"default_tokenizer" => "TokenBigram"})
168
+ assert_equal("TokenBigram", command.default_tokenizer)
169
+ end
170
+
171
+ def test_omitted
172
+ command = table_create_command
173
+ assert_nil(command.default_tokenizer)
174
+ end
175
+ end
176
+
177
+ class NormalizerTest < self
178
+ def test_specified
179
+ command = table_create_command({"normalizer" => "NormalizerAuto"})
180
+ assert_equal("NormalizerAuto", command.normalizer)
181
+ end
182
+
183
+ def test_omitted
184
+ command = table_create_command
185
+ assert_nil(command.normalizer)
186
+ end
187
+ end
152
188
  end
metadata CHANGED
@@ -1,142 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-command
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
5
- prerelease:
4
+ version: 1.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kouhei Sutou
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-29 00:00:00.000000000 Z
11
+ date: 2014-03-15 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: json
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: test-unit
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: test-unit-notify
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: bundler
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: packnga
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: yard
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: redcarpet
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  description: ''
@@ -151,107 +134,106 @@ files:
151
134
  - Gemfile
152
135
  - groonga-command.gemspec
153
136
  - .yardopts
154
- - lib/groonga/command/truncate.rb
155
137
  - lib/groonga/command/table-remove.rb
156
- - lib/groonga/command/ruby-eval.rb
157
- - lib/groonga/command/load.rb
158
- - lib/groonga/command/delete.rb
159
- - lib/groonga/command/base.rb
160
- - lib/groonga/command/suggest.rb
161
- - lib/groonga/command/status.rb
138
+ - lib/groonga/command/get.rb
139
+ - lib/groonga/command/column-remove.rb
140
+ - lib/groonga/command/select.rb
141
+ - lib/groonga/command/table-create.rb
142
+ - lib/groonga/command/ruby-load.rb
143
+ - lib/groonga/command/column-rename.rb
144
+ - lib/groonga/command/version.rb
162
145
  - lib/groonga/command/error.rb
146
+ - lib/groonga/command/column-create.rb
163
147
  - lib/groonga/command/register.rb
164
- - lib/groonga/command/version.rb
165
- - lib/groonga/command/column-remove.rb
148
+ - lib/groonga/command/suggest.rb
166
149
  - lib/groonga/command/column-list.rb
167
- - lib/groonga/command/column-rename.rb
150
+ - lib/groonga/command/truncate.rb
151
+ - lib/groonga/command/status.rb
152
+ - lib/groonga/command/base.rb
153
+ - lib/groonga/command/table-rename.rb
154
+ - lib/groonga/command/ruby-eval.rb
155
+ - lib/groonga/command/format/uri.rb
156
+ - lib/groonga/command/format/command.rb
168
157
  - lib/groonga/command/dump.rb
169
158
  - lib/groonga/command/normalize.rb
170
- - lib/groonga/command/table-create.rb
171
- - lib/groonga/command/format/command.rb
172
- - lib/groonga/command/format/uri.rb
173
- - lib/groonga/command/column-create.rb
174
- - lib/groonga/command/get.rb
175
- - lib/groonga/command/ruby-load.rb
176
- - lib/groonga/command/select.rb
177
- - lib/groonga/command/table-rename.rb
159
+ - lib/groonga/command/delete.rb
178
160
  - lib/groonga/command/tokenize.rb
161
+ - lib/groonga/command/load.rb
179
162
  - lib/groonga/command.rb
180
163
  - doc/text/news.md
181
164
  - doc/text/lgpl-2.1.txt
182
- - test/groonga-command-test-utils.rb
183
- - test/run-test.rb
184
- - test/command/test-table-create.rb
185
- - test/command/test-status.rb
186
- - test/command/test-ruby-load.rb
165
+ - test/command/test-get.rb
187
166
  - test/command/test-ruby-eval.rb
188
- - test/command/test-tokenize.rb
189
- - test/command/test-dump.rb
190
- - test/command/test-table-rename.rb
191
- - test/command/test-table-remove.rb
192
- - test/command/test-truncate.rb
193
- - test/command/test-delete.rb
194
- - test/command/test-select.rb
195
- - test/command/test-column-list.rb
196
- - test/command/test-base.rb
197
- - test/command/test-column-create.rb
198
167
  - test/command/test-register.rb
199
- - test/command/test-get.rb
200
- - test/command/test-suggest.rb
201
168
  - test/command/test-normalize.rb
202
- - test/command/format/test-command.rb
169
+ - test/command/test-column-list.rb
203
170
  - test/command/test-column-rename.rb
171
+ - test/command/test-delete.rb
172
+ - test/command/test-table-remove.rb
173
+ - test/command/test-suggest.rb
174
+ - test/command/test-status.rb
175
+ - test/command/test-ruby-load.rb
176
+ - test/command/test-truncate.rb
177
+ - test/command/test-base.rb
204
178
  - test/command/test-load.rb
179
+ - test/command/test-column-create.rb
180
+ - test/command/test-table-rename.rb
205
181
  - test/command/test-column-remove.rb
182
+ - test/command/test-dump.rb
183
+ - test/command/test-table-create.rb
184
+ - test/command/test-tokenize.rb
185
+ - test/command/format/test-command.rb
186
+ - test/command/test-select.rb
187
+ - test/groonga-command-test-utils.rb
188
+ - test/run-test.rb
206
189
  homepage: https://github.com/groonga/groonga-command
207
190
  licenses:
208
191
  - LGPLv2.1+
192
+ metadata: {}
209
193
  post_install_message:
210
194
  rdoc_options: []
211
195
  require_paths:
212
196
  - lib
213
197
  required_ruby_version: !ruby/object:Gem::Requirement
214
- none: false
215
198
  requirements:
216
- - - ! '>='
199
+ - - '>='
217
200
  - !ruby/object:Gem::Version
218
201
  version: '0'
219
202
  required_rubygems_version: !ruby/object:Gem::Requirement
220
- none: false
221
203
  requirements:
222
- - - ! '>='
204
+ - - '>='
223
205
  - !ruby/object:Gem::Version
224
206
  version: '0'
225
207
  requirements: []
226
208
  rubyforge_project:
227
- rubygems_version: 1.8.23
209
+ rubygems_version: 2.0.13
228
210
  signing_key:
229
- specification_version: 3
211
+ specification_version: 4
230
212
  summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s
231
213
  command. You can write a program that handle Groonga's command by using groonga-command.
232
214
  test_files:
233
- - test/groonga-command-test-utils.rb
234
- - test/run-test.rb
235
- - test/command/test-table-create.rb
236
- - test/command/test-status.rb
237
- - test/command/test-ruby-load.rb
215
+ - test/command/test-get.rb
238
216
  - test/command/test-ruby-eval.rb
239
- - test/command/test-tokenize.rb
240
- - test/command/test-dump.rb
241
- - test/command/test-table-rename.rb
242
- - test/command/test-table-remove.rb
243
- - test/command/test-truncate.rb
244
- - test/command/test-delete.rb
245
- - test/command/test-select.rb
246
- - test/command/test-column-list.rb
247
- - test/command/test-base.rb
248
- - test/command/test-column-create.rb
249
217
  - test/command/test-register.rb
250
- - test/command/test-get.rb
251
- - test/command/test-suggest.rb
252
218
  - test/command/test-normalize.rb
253
- - test/command/format/test-command.rb
219
+ - test/command/test-column-list.rb
254
220
  - test/command/test-column-rename.rb
221
+ - test/command/test-delete.rb
222
+ - test/command/test-table-remove.rb
223
+ - test/command/test-suggest.rb
224
+ - test/command/test-status.rb
225
+ - test/command/test-ruby-load.rb
226
+ - test/command/test-truncate.rb
227
+ - test/command/test-base.rb
255
228
  - test/command/test-load.rb
229
+ - test/command/test-column-create.rb
230
+ - test/command/test-table-rename.rb
256
231
  - test/command/test-column-remove.rb
232
+ - test/command/test-dump.rb
233
+ - test/command/test-table-create.rb
234
+ - test/command/test-tokenize.rb
235
+ - test/command/format/test-command.rb
236
+ - test/command/test-select.rb
237
+ - test/groonga-command-test-utils.rb
238
+ - test/run-test.rb
257
239
  has_rdoc: