groonga-command-parser 1.0.5 → 1.0.6

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
2
  SHA1:
3
- metadata.gz: d57a072e7f7777830941dca1314a03d42a4b656e
4
- data.tar.gz: 5260af5b490df1a910e03e0d002037cb1b6bd2d8
3
+ metadata.gz: a75084a7badb6eaff6d7904c21749782c1565eab
4
+ data.tar.gz: 8e5f32b9c0ac5cbfe347e356fb8fc3843e0f52d4
5
5
  SHA512:
6
- metadata.gz: 78894a5a7e7913d26b12f6487760bc0c212913170526bf3c436abbfe40c86217b3a015fe8c7ad171fb96c180e0a9c174943d1c6c53094ce0e1817151def8da15
7
- data.tar.gz: 2ac829c0a6fd339c6b10dbb8d113c646750705aca2f27aead80772b46aa0484e09a3514ddf39b631fa27f91d83d9362fe365da28985234d1a860e0dd3cdc7b71
6
+ metadata.gz: cc7cb7b7c40a7459bc15ac2be6aa69e8c695a330ba86c8e6df3b69516d9801533ed39ac411cb1746756ecdd9d3a1eb220f90d7e2735d04d6ee17cbbee6f76f4c
7
+ data.tar.gz: da59b07ea452dc7dc7be75eea93b8dfb960c85ac9ac019ccde3f9162b4d49497b7fec01056656a64920afe1735c93b58b6a9483b6cba0b8333112a782aac91ff
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.0.6: 2016-09-12
4
+
5
+ ### Improvements
6
+
7
+ * Supported no command name URI such as `/`.
8
+
3
9
  ## 1.0.5: 2015-08-08
4
10
 
5
11
  ### Improvements
@@ -248,13 +248,15 @@ module Groonga
248
248
  on_comment($POSTMATCH)
249
249
  else
250
250
  @command = parse_command(line)
251
+ return if @command.nil?
252
+
251
253
  @command.original_source = line
252
254
  process_command
253
255
  end
254
256
  end
255
257
 
256
258
  def process_command
257
- if @command.name == "load"
259
+ if @command.command_name == "load"
258
260
  on_load_start(@command)
259
261
  if @command.columns
260
262
  on_load_columns(@command, @command.columns)
@@ -302,6 +304,9 @@ module Groonga
302
304
  prefix = ""
303
305
  name = path
304
306
  end
307
+
308
+ return nil if name.empty?
309
+
305
310
  name, output_type = name.split(/\./, 2)
306
311
  arguments["output_type"] = output_type if output_type
307
312
  command_class = ::Groonga::Command.find(name)
@@ -16,8 +16,6 @@
16
16
  # License along with this library; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
- # TODO: Remove me when https://github.com/chef/ffi-yajl/pull/62 is merged.
20
- require "stringio"
21
19
  ENV["FORCE_FFI_YAJL"] = "ffi"
22
20
  require "ffi_yajl"
23
21
 
@@ -19,7 +19,7 @@
19
19
  module Groonga
20
20
  module Command
21
21
  class Parser
22
- VERSION = "1.0.5"
22
+ VERSION = "1.0.6"
23
23
  end
24
24
  end
25
25
  end
@@ -81,6 +81,13 @@ class ParserTest < Test::Unit::TestCase
81
81
  assert_equal("/groonga/db1", command.path_prefix)
82
82
  end
83
83
 
84
+ def test_no_command_name
85
+ error = Groonga::Command::Parser::Error.new("not completed", "/", "")
86
+ assert_raise(error) do
87
+ Groonga::Command::Parser.parse("/")
88
+ end
89
+ end
90
+
84
91
  class ParseTest < self
85
92
  include ParseTests
86
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-command-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-08 00:00:00.000000000 Z
11
+ date: 2016-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: groonga-command
@@ -200,15 +200,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  version: '0'
201
201
  requirements: []
202
202
  rubyforge_project:
203
- rubygems_version: 2.2.2
203
+ rubygems_version: 2.5.1
204
204
  signing_key:
205
205
  specification_version: 4
206
206
  summary: Groonga-command-parser is a Ruby library to parses [groonga](http://groonga.org/)'s
207
207
  command syntax. You can write a program to process groonga's command by using groonga-command-parser.
208
208
  test_files:
209
- - test/groonga-command-parser-test-utils.rb
210
209
  - test/run-test.rb
211
- - test/test-command-line-splitter.rb
212
- - test/test-load-value-parser.rb
213
210
  - test/test-parser.rb
211
+ - test/test-load-value-parser.rb
212
+ - test/test-command-line-splitter.rb
213
+ - test/groonga-command-parser-test-utils.rb
214
214
  has_rdoc: