groonga-command 1.0.7 → 1.0.8

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
  SHA1:
3
- metadata.gz: fd064a51b4d30a9e01f074b9a716cf38044e723a
4
- data.tar.gz: 7ea59d11a39b99e03ac19649007605d6e6f36150
3
+ metadata.gz: 497f66a7936df08f194c0d8bd0c5bfc239609736
4
+ data.tar.gz: cd110b893efee85d64cf89e81accda9d9a75d49b
5
5
  SHA512:
6
- metadata.gz: 246c7bbef1f92f27bfb8f0d9d66004b79d78120fd0ec75daa2c02d4fd2bd4ed7bb0dc6e68beed4e73dadc840dcb464750c2e3ca3ec3524d97ea5389a2f8bdf2b
7
- data.tar.gz: 98ca09fb709fdafa3ded9025aee35f62bc71464c73b3b740845583c9053cfd367c1e3d06106aa0554f58b7e560f9eab40cb5561ac650da8220a1c0609a99747f
6
+ metadata.gz: 0390d8f45f28818a934096470b1163fad2c4d6ac629b4272ca0160dbef2ea74ad1665a7e6b0a2404477fc15741a7ab7238c089ee0cf7ff87b8769f449def2d2f
7
+ data.tar.gz: 9536d0946225108ff00c6792890e59250e1e4a68a4264da8578a658ec6f70adae063a4ffd8d26fc5e453b88457ac6a34ab77f52813ebc9a092137f0cff4f52d7
data/doc/text/news.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # News
2
2
 
3
+ ## 1.0.8: 2014-09-30
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::Base#key?}: Added.
8
+ * Accepted nil value arguments on formatting to URI or command line.
9
+ Nil value arguments are ignored.
10
+
3
11
  ## 1.0.7: 2014-03-15
4
12
 
5
13
  ### Improvements
@@ -56,9 +56,10 @@ module Groonga
56
56
  @arguments[normalize_name(name)] = value
57
57
  end
58
58
 
59
- def has_key?(name)
60
- @arguments.has_key?(normalize_name(name))
59
+ def key?(name)
60
+ @arguments.key?(normalize_name(name))
61
61
  end
62
+ alias_method :has_key?, :key?
62
63
 
63
64
  def ==(other)
64
65
  other.is_a?(self.class) and
@@ -79,11 +80,11 @@ module Groonga
79
80
  end
80
81
 
81
82
  def to_uri_format
82
- Format::URI.new(@name, @arguments).path
83
+ Format::URI.new(@name, normalized_arguments).path
83
84
  end
84
85
 
85
86
  def to_command_format
86
- Format::Command.new(@name, @arguments).command_line
87
+ Format::Command.new(@name, normalized_arguments).command_line
87
88
  end
88
89
 
89
90
  private
@@ -110,6 +111,12 @@ module Groonga
110
111
  name = name.to_sym if name.is_a?(String)
111
112
  name
112
113
  end
114
+
115
+ def normalized_arguments
116
+ @arguments.reject do |_, value|
117
+ value.nil?
118
+ end
119
+ end
113
120
  end
114
121
  end
115
122
  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
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Groonga
20
20
  module Command
21
- VERSION = "1.0.7"
21
+ VERSION = "1.0.8"
22
22
  end
23
23
  end
@@ -48,6 +48,15 @@ class BaseCommandTest < Test::Unit::TestCase
48
48
  "keyword+%40+%22%E9%A4%8A%E6%AE%96%22&table=Users",
49
49
  select.to_uri_format)
50
50
  end
51
+
52
+ def test_nil
53
+ select = Groonga::Command::Base.new("select",
54
+ :table => "Users",
55
+ :filter => nil,
56
+ :output_type => "json")
57
+ assert_equal("/d/select.json?table=Users",
58
+ select.to_uri_format)
59
+ end
51
60
  end
52
61
 
53
62
  class CovnertToCommandFormatTest < self
@@ -81,6 +90,15 @@ class BaseCommandTest < Test::Unit::TestCase
81
90
  "--output_type \"json\" --table \"Users\"",
82
91
  select.to_command_format)
83
92
  end
93
+
94
+ def test_nil
95
+ select = Groonga::Command::Base.new("select",
96
+ :table => "Users",
97
+ :filter => nil,
98
+ :output_type => "json")
99
+ assert_equal("select --output_type \"json\" --table \"Users\"",
100
+ select.to_command_format)
101
+ end
84
102
  end
85
103
 
86
104
  sub_test_case("#[]") do
@@ -98,6 +116,20 @@ class BaseCommandTest < Test::Unit::TestCase
98
116
  end
99
117
  end
100
118
 
119
+ sub_test_case("#key?") do
120
+ def setup
121
+ @select = Groonga::Command::Base.new("select", :table => "Users")
122
+ end
123
+
124
+ def test_symbol
125
+ assert_true(@select.key?(:table))
126
+ end
127
+
128
+ def test_string
129
+ assert_true(@select.key?("table"))
130
+ end
131
+ end
132
+
101
133
  sub_test_case("#has_key?") do
102
134
  def setup
103
135
  @select = Groonga::Command::Base.new("select", :table => "Users")
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-command
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-15 00:00:00.000000000 Z
11
+ date: 2014-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: test-unit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit-notify
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: packnga
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: yard
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: redcarpet
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description: ''
@@ -129,61 +129,61 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - ".yardopts"
133
+ - Gemfile
132
134
  - README.md
133
135
  - Rakefile
134
- - Gemfile
136
+ - doc/text/lgpl-2.1.txt
137
+ - doc/text/news.md
135
138
  - groonga-command.gemspec
136
- - .yardopts
137
- - lib/groonga/command/table-remove.rb
138
- - lib/groonga/command/get.rb
139
+ - lib/groonga/command.rb
140
+ - lib/groonga/command/base.rb
141
+ - lib/groonga/command/column-create.rb
142
+ - lib/groonga/command/column-list.rb
139
143
  - 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
144
  - lib/groonga/command/column-rename.rb
144
- - lib/groonga/command/version.rb
145
+ - lib/groonga/command/delete.rb
146
+ - lib/groonga/command/dump.rb
145
147
  - lib/groonga/command/error.rb
146
- - lib/groonga/command/column-create.rb
148
+ - lib/groonga/command/format/command.rb
149
+ - lib/groonga/command/format/uri.rb
150
+ - lib/groonga/command/get.rb
151
+ - lib/groonga/command/load.rb
152
+ - lib/groonga/command/normalize.rb
147
153
  - lib/groonga/command/register.rb
148
- - lib/groonga/command/suggest.rb
149
- - lib/groonga/command/column-list.rb
150
- - lib/groonga/command/truncate.rb
154
+ - lib/groonga/command/ruby-eval.rb
155
+ - lib/groonga/command/ruby-load.rb
156
+ - lib/groonga/command/select.rb
151
157
  - lib/groonga/command/status.rb
152
- - lib/groonga/command/base.rb
158
+ - lib/groonga/command/suggest.rb
159
+ - lib/groonga/command/table-create.rb
160
+ - lib/groonga/command/table-remove.rb
153
161
  - 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
157
- - lib/groonga/command/dump.rb
158
- - lib/groonga/command/normalize.rb
159
- - lib/groonga/command/delete.rb
160
162
  - lib/groonga/command/tokenize.rb
161
- - lib/groonga/command/load.rb
162
- - lib/groonga/command.rb
163
- - doc/text/news.md
164
- - doc/text/lgpl-2.1.txt
165
- - test/command/test-get.rb
166
- - test/command/test-ruby-eval.rb
167
- - test/command/test-register.rb
168
- - test/command/test-normalize.rb
169
- - test/command/test-column-list.rb
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
163
+ - lib/groonga/command/truncate.rb
164
+ - lib/groonga/command/version.rb
165
+ - test/command/format/test-command.rb
177
166
  - test/command/test-base.rb
178
- - test/command/test-load.rb
179
167
  - test/command/test-column-create.rb
180
- - test/command/test-table-rename.rb
168
+ - test/command/test-column-list.rb
181
169
  - test/command/test-column-remove.rb
170
+ - test/command/test-column-rename.rb
171
+ - test/command/test-delete.rb
182
172
  - test/command/test-dump.rb
173
+ - test/command/test-get.rb
174
+ - test/command/test-load.rb
175
+ - test/command/test-normalize.rb
176
+ - test/command/test-register.rb
177
+ - test/command/test-ruby-eval.rb
178
+ - test/command/test-ruby-load.rb
179
+ - test/command/test-select.rb
180
+ - test/command/test-status.rb
181
+ - test/command/test-suggest.rb
183
182
  - test/command/test-table-create.rb
183
+ - test/command/test-table-remove.rb
184
+ - test/command/test-table-rename.rb
184
185
  - test/command/test-tokenize.rb
185
- - test/command/format/test-command.rb
186
- - test/command/test-select.rb
186
+ - test/command/test-truncate.rb
187
187
  - test/groonga-command-test-utils.rb
188
188
  - test/run-test.rb
189
189
  homepage: https://github.com/groonga/groonga-command
@@ -196,44 +196,44 @@ require_paths:
196
196
  - lib
197
197
  required_ruby_version: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - '>='
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  requirements:
204
- - - '>='
204
+ - - ">="
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.0.13
209
+ rubygems_version: 2.2.2
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s
213
213
  command. You can write a program that handle Groonga's command by using groonga-command.
214
214
  test_files:
215
- - test/command/test-get.rb
216
- - test/command/test-ruby-eval.rb
217
- - test/command/test-register.rb
218
- - test/command/test-normalize.rb
219
- - test/command/test-column-list.rb
220
- - test/command/test-column-rename.rb
221
- - test/command/test-delete.rb
215
+ - test/command/test-column-remove.rb
222
216
  - test/command/test-table-remove.rb
217
+ - test/command/test-column-rename.rb
218
+ - test/command/test-column-create.rb
219
+ - test/command/test-select.rb
223
220
  - test/command/test-suggest.rb
224
- - test/command/test-status.rb
225
- - test/command/test-ruby-load.rb
221
+ - test/command/test-column-list.rb
222
+ - test/command/test-load.rb
223
+ - test/command/test-dump.rb
226
224
  - test/command/test-truncate.rb
225
+ - test/command/test-delete.rb
226
+ - test/command/test-ruby-load.rb
227
227
  - test/command/test-base.rb
228
- - test/command/test-load.rb
229
- - test/command/test-column-create.rb
230
228
  - test/command/test-table-rename.rb
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
229
+ - test/command/test-normalize.rb
230
+ - test/command/test-get.rb
235
231
  - test/command/format/test-command.rb
236
- - test/command/test-select.rb
237
- - test/groonga-command-test-utils.rb
232
+ - test/command/test-tokenize.rb
233
+ - test/command/test-ruby-eval.rb
234
+ - test/command/test-status.rb
235
+ - test/command/test-register.rb
236
+ - test/command/test-table-create.rb
238
237
  - test/run-test.rb
238
+ - test/groonga-command-test-utils.rb
239
239
  has_rdoc: