groonga-command 1.0.8 → 1.0.9

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: 497f66a7936df08f194c0d8bd0c5bfc239609736
4
- data.tar.gz: cd110b893efee85d64cf89e81accda9d9a75d49b
3
+ metadata.gz: 68d0eaf0ca515aaea746a431cb13048d982c1b51
4
+ data.tar.gz: 7860e3f59264b32f94e066acb0f526fd7a4f02b8
5
5
  SHA512:
6
- metadata.gz: 0390d8f45f28818a934096470b1163fad2c4d6ac629b4272ca0160dbef2ea74ad1665a7e6b0a2404477fc15741a7ab7238c089ee0cf7ff87b8769f449def2d2f
7
- data.tar.gz: 9536d0946225108ff00c6792890e59250e1e4a68a4264da8578a658ec6f70adae063a4ffd8d26fc5e453b88457ac6a34ab77f52813ebc9a092137f0cff4f52d7
6
+ metadata.gz: 78b85d0154bbeb6b6f6db1d0f1afa2436388629b1326886087528ea8c0a1a06a60c19a3e938735a19ce178e1b1fefb843e9beec9428528277a66111ab15e6f37
7
+ data.tar.gz: c8389b28bd5127700a8c6f01077e836f147502a26338a67c786d19f7de9be5ef39fe18698edbaed19f44a0d9e40fc133cdef68caf1a825bbcc01b8e804fd314f
data/doc/text/news.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # News
2
2
 
3
+ ## 1.0.9: 2014-10-02
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::Base#path_prefix}: Added.
8
+ [GitHub#1] [Patch by Hajime Wakahara]
9
+ * {Groonga::Command::Base#path_prefix=}: Added. It is for customizing
10
+ "/d" position in command URI.
11
+ [GitHub#1] [Patch by Hajime Wakahara]
12
+
13
+ ### Thanks
14
+
15
+ * Hajime Wakahara
16
+
3
17
  ## 1.0.8: 2014-09-30
4
18
 
5
19
  ### Improvements
@@ -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
@@ -40,12 +40,13 @@ module Groonga
40
40
  end
41
41
 
42
42
  attr_reader :name, :arguments
43
- attr_accessor :original_format, :original_source
43
+ attr_accessor :original_format, :original_source, :path_prefix
44
44
  def initialize(name, pair_arguments, ordered_arguments=[])
45
45
  @name = name
46
46
  @arguments = construct_arguments(pair_arguments, ordered_arguments)
47
47
  @original_format = nil
48
48
  @original_source = nil
49
+ @path_prefix = "/d/"
49
50
  end
50
51
 
51
52
  def [](name)
@@ -80,7 +81,7 @@ module Groonga
80
81
  end
81
82
 
82
83
  def to_uri_format
83
- Format::URI.new(@name, normalized_arguments).path
84
+ Format::URI.new(@path_prefix, @name, normalized_arguments).path
84
85
  end
85
86
 
86
87
  def to_command_format
@@ -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
@@ -22,13 +22,14 @@ module Groonga
22
22
  module Command
23
23
  module Format
24
24
  class URI
25
- def initialize(name, arguments)
25
+ def initialize(path_prefix, name, arguments)
26
+ @path_prefix = path_prefix
26
27
  @name = name
27
28
  @arguments = arguments
28
29
  end
29
30
 
30
31
  def path
31
- path = "/d/#{@name}"
32
+ path = [@path_prefix.chomp("/"), @name].join("/")
32
33
  arguments = @arguments.dup
33
34
  output_type = arguments.delete(:output_type)
34
35
  path << ".#{output_type}" if output_type
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Groonga
20
20
  module Command
21
- VERSION = "1.0.8"
21
+ VERSION = "1.0.9"
22
22
  end
23
23
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2011-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
@@ -57,6 +57,15 @@ class BaseCommandTest < Test::Unit::TestCase
57
57
  assert_equal("/d/select.json?table=Users",
58
58
  select.to_uri_format)
59
59
  end
60
+
61
+ def test_path_prefix
62
+ select = Groonga::Command::Base.new("select",
63
+ :table => "Users",
64
+ :output_type => "json")
65
+ select.path_prefix = "/db1"
66
+ assert_equal("/db1/select.json?table=Users",
67
+ select.to_uri_format)
68
+ end
60
69
  end
61
70
 
62
71
  class CovnertToCommandFormatTest < self
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.0.8
4
+ version: 1.0.9
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-09-30 00:00:00.000000000 Z
11
+ date: 2014-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -212,28 +212,28 @@ 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-column-remove.rb
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
220
- - test/command/test-suggest.rb
221
- - test/command/test-column-list.rb
222
- - test/command/test-load.rb
223
- - test/command/test-dump.rb
224
- - test/command/test-truncate.rb
225
- - test/command/test-delete.rb
215
+ - test/groonga-command-test-utils.rb
216
+ - test/command/test-normalize.rb
226
217
  - test/command/test-ruby-load.rb
227
- - test/command/test-base.rb
228
218
  - test/command/test-table-rename.rb
229
- - test/command/test-normalize.rb
230
- - test/command/test-get.rb
219
+ - test/command/test-dump.rb
220
+ - test/command/test-base.rb
221
+ - test/command/test-status.rb
222
+ - test/command/test-table-remove.rb
231
223
  - test/command/format/test-command.rb
232
- - test/command/test-tokenize.rb
224
+ - test/command/test-delete.rb
225
+ - test/command/test-select.rb
226
+ - test/command/test-table-create.rb
227
+ - test/command/test-load.rb
228
+ - test/command/test-suggest.rb
229
+ - test/command/test-column-rename.rb
233
230
  - test/command/test-ruby-eval.rb
234
- - test/command/test-status.rb
231
+ - test/command/test-tokenize.rb
232
+ - test/command/test-column-remove.rb
233
+ - test/command/test-truncate.rb
234
+ - test/command/test-column-create.rb
235
235
  - test/command/test-register.rb
236
- - test/command/test-table-create.rb
236
+ - test/command/test-column-list.rb
237
+ - test/command/test-get.rb
237
238
  - test/run-test.rb
238
- - test/groonga-command-test-utils.rb
239
239
  has_rdoc: