groonga-command 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +14 -0
- data/lib/groonga/command/base.rb +4 -3
- data/lib/groonga/command/format/uri.rb +4 -3
- data/lib/groonga/command/version.rb +1 -1
- data/test/command/test-base.rb +10 -1
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68d0eaf0ca515aaea746a431cb13048d982c1b51
|
4
|
+
data.tar.gz: 7860e3f59264b32f94e066acb0f526fd7a4f02b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/groonga/command/base.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2012-
|
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-
|
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 = "/
|
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
|
data/test/command/test-base.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2011-
|
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.
|
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-
|
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
|
216
|
-
- test/command/test-
|
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-
|
230
|
-
- test/command/test-
|
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-
|
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-
|
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-
|
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:
|