gqtp 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +21 -0
- data/README.md +76 -0
- data/Rakefile +44 -0
- data/doc/text/news.md +8 -1
- data/gqtp.gemspec +53 -0
- data/lib/gqtp/version.rb +1 -1
- metadata +8 -4
data/Gemfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- mode: ruby; coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
source :rubygems
|
20
|
+
|
21
|
+
gemspec
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# README
|
2
|
+
|
3
|
+
## Name
|
4
|
+
|
5
|
+
gqtp
|
6
|
+
|
7
|
+
## Description
|
8
|
+
|
9
|
+
Gqtp gem is a
|
10
|
+
[GQTP (Groonga Query Transfer Protocol)](http://groonga.org/docs/spec/gqtp.html)
|
11
|
+
Ruby implementation.
|
12
|
+
|
13
|
+
Gqtp gem provides both GQTP client, GQTP server and GQTP proxy
|
14
|
+
implementations. They provide asynchronous API. You can use gqtp gem
|
15
|
+
for high concurrency use.
|
16
|
+
|
17
|
+
## Install
|
18
|
+
|
19
|
+
% gem install gqtp
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### Client
|
24
|
+
|
25
|
+
client = GQTP::Client.new(:address => "192.168.0.1", :port => 10041)
|
26
|
+
request = client.send("status") do |header, body|
|
27
|
+
p body # => "{\"alloc_count\":163,...}"
|
28
|
+
end
|
29
|
+
request.wait
|
30
|
+
|
31
|
+
### Server
|
32
|
+
|
33
|
+
server = GQTP::Server.new(:address => "192.168.0.1", :port => 10041)
|
34
|
+
server.on_request do |request, client|
|
35
|
+
body = "{\"alloc_count\":163,...}"
|
36
|
+
header = GQTP::Header.new
|
37
|
+
header.query_type = GQTP::Header::ContentType::JSON
|
38
|
+
header.flags = GQTP::Header::Flag::TAIL
|
39
|
+
header.size = body.bytesize
|
40
|
+
client.write(header.pack, body) do
|
41
|
+
client.close
|
42
|
+
end
|
43
|
+
end
|
44
|
+
server.run.wait
|
45
|
+
|
46
|
+
### Proxy
|
47
|
+
|
48
|
+
proxy = GQTP::Proxy.new(:listen_address => "127.0.0.1",
|
49
|
+
:listen_port => 10041,
|
50
|
+
:upstream_address => "192.168.0.1",
|
51
|
+
:upstream_port => 10041)
|
52
|
+
proxy.run.wait
|
53
|
+
|
54
|
+
## Dependencies
|
55
|
+
|
56
|
+
* Ruby 1.9.3
|
57
|
+
|
58
|
+
## Mailing list
|
59
|
+
|
60
|
+
* English: [groonga-talk@lists.sourceforge.net](https://lists.sourceforge.net/lists/listinfo/groonga-talk)
|
61
|
+
* Japanese: [groonga-dev@lists.sourceforge.jp](http://lists.sourceforge.jp/mailman/listinfo/groonga-dev)
|
62
|
+
|
63
|
+
## Thanks
|
64
|
+
|
65
|
+
* ...
|
66
|
+
|
67
|
+
## Authors
|
68
|
+
|
69
|
+
* Kouhei Sutou \<kou@clear-code.com\>
|
70
|
+
|
71
|
+
## License
|
72
|
+
|
73
|
+
LGPLv2.1 or later. See doc/text/lgpl-2.1.txt for details.
|
74
|
+
|
75
|
+
(Kouhei Sutou has a right to change the license including contributed
|
76
|
+
patches.)
|
data/Rakefile
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# -*- mode: ruby; coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
task :default => :test
|
20
|
+
|
21
|
+
require "rubygems"
|
22
|
+
require "bundler/gem_helper"
|
23
|
+
require "packnga"
|
24
|
+
|
25
|
+
base_dir = File.join(File.dirname(__FILE__))
|
26
|
+
|
27
|
+
helper = Bundler::GemHelper.new(base_dir)
|
28
|
+
def helper.version_tag
|
29
|
+
version
|
30
|
+
end
|
31
|
+
|
32
|
+
helper.install
|
33
|
+
spec = helper.gemspec
|
34
|
+
|
35
|
+
Packnga::DocumentTask.new(spec) do
|
36
|
+
end
|
37
|
+
|
38
|
+
Packnga::ReleaseTask.new(spec) do
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "Run tests"
|
42
|
+
task :test do
|
43
|
+
ruby("test/run-test.rb")
|
44
|
+
end
|
data/doc/text/news.md
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 1.0.3: 2013-01-07
|
4
|
+
|
5
|
+
### Fixes
|
6
|
+
|
7
|
+
* Fixed the bug anyone can't see README document in rubydoc.info.
|
8
|
+
README URL: http://rubydoc.info/gems/gqtp/
|
9
|
+
|
3
10
|
## 1.0.2: 2012-12-29
|
4
11
|
|
5
12
|
### Fixes
|
6
13
|
|
7
|
-
*
|
14
|
+
* Added missing file for documentaion.
|
8
15
|
|
9
16
|
## 1.0.1: 2012-12-29
|
10
17
|
|
data/gqtp.gemspec
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# -*- mode: ruby; coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
clean_white_space = lambda do |entry|
|
20
|
+
entry.gsub(/(\A\n+|\n+\z)/, '') + "\n"
|
21
|
+
end
|
22
|
+
|
23
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
|
24
|
+
require "gqtp/version"
|
25
|
+
|
26
|
+
Gem::Specification.new do |spec|
|
27
|
+
spec.name = "gqtp"
|
28
|
+
spec.version = GQTP::VERSION
|
29
|
+
spec.homepage = "https://github.com/ranguba/gqtp"
|
30
|
+
spec.authors = ["Kouhei Sutou"]
|
31
|
+
spec.email = ["kou@clear-code.com"]
|
32
|
+
readme = File.read("README.md")
|
33
|
+
readme.force_encoding("UTF-8") if readme.respond_to?(:force_encoding)
|
34
|
+
entries = readme.split(/^\#\#\s(.*)$/)
|
35
|
+
description = clean_white_space.call(entries[entries.index("Description") + 1])
|
36
|
+
spec.summary, spec.description, = description.split(/\n\n+/, 3)
|
37
|
+
spec.license = "LGPLv2.1 or later"
|
38
|
+
spec.files = ["README.md", "Rakefile", "Gemfile", "#{spec.name}.gemspec"]
|
39
|
+
spec.files += [".yardopts"]
|
40
|
+
spec.files += Dir.glob("lib/**/*.rb")
|
41
|
+
spec.files += Dir.glob("doc/text/*")
|
42
|
+
spec.test_files += Dir.glob("test/**/*")
|
43
|
+
Dir.chdir("bin") do
|
44
|
+
spec.executables = Dir.glob("*")
|
45
|
+
end
|
46
|
+
|
47
|
+
spec.add_development_dependency("bundler")
|
48
|
+
spec.add_development_dependency("rake")
|
49
|
+
spec.add_development_dependency("test-unit")
|
50
|
+
spec.add_development_dependency("test-unit-notify")
|
51
|
+
spec.add_development_dependency("packnga")
|
52
|
+
spec.add_development_dependency("redcarpet")
|
53
|
+
end
|
data/lib/gqtp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gqtp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -121,6 +121,10 @@ executables:
|
|
121
121
|
extensions: []
|
122
122
|
extra_rdoc_files: []
|
123
123
|
files:
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- Gemfile
|
127
|
+
- gqtp.gemspec
|
124
128
|
- .yardopts
|
125
129
|
- lib/gqtp/parser.rb
|
126
130
|
- lib/gqtp/server.rb
|
@@ -155,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
159
|
version: '0'
|
156
160
|
segments:
|
157
161
|
- 0
|
158
|
-
hash:
|
162
|
+
hash: 2123818797887154120
|
159
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
164
|
none: false
|
161
165
|
requirements:
|
@@ -164,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
168
|
version: '0'
|
165
169
|
segments:
|
166
170
|
- 0
|
167
|
-
hash:
|
171
|
+
hash: 2123818797887154120
|
168
172
|
requirements: []
|
169
173
|
rubyforge_project:
|
170
174
|
rubygems_version: 1.8.23
|