grnlip 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +13 -0
- data/README.md +12 -2
- data/exe/grnlip +15 -3
- data/grnlip.gemspec +1 -1
- data/lib/grnlip/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f85dad5470eca3d2004d6ad90a58526425a05aa
|
4
|
+
data.tar.gz: 0a77c974e96c4917902bfd9e73bc337711a0853d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15f559eac17d64e810b5125f7ea9f37ae158da8ced6151977e86ca439c5ae9c0584d1e9f09090f8d0c9edab099acc3306b1130d80f7ea3d9562e686e0fb43db3
|
7
|
+
data.tar.gz: bdc23a58bbbf56d5b40e4e89e8f2464bf96a3779964d868ef5488d4fad8975950ea38414f78d60086779921971d437ecbf08d2379789458b22b7e0941d6f0768
|
data/NEWS.md
ADDED
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Grnlip
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/grnlip.svg)](http://badge.fury.io/rb/grnlip)
|
4
|
+
|
5
|
+
A CLI for [Groonga](http://groonga.org/) using Readline. Supports Windows.
|
6
|
+
|
7
|
+
## TODO
|
8
|
+
|
9
|
+
* ...
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -8,12 +14,16 @@ A command line interface for [Groonga](http://groonga.org/).
|
|
8
14
|
|
9
15
|
## Usage
|
10
16
|
|
11
|
-
$ grnlip GROONGA_EXE_PATH DB_PATH
|
17
|
+
$ grnlip GROONGA_EXE_PATH DB_PATH [DB_ENCODING]
|
12
18
|
|
13
19
|
For example:
|
14
20
|
|
15
21
|
$ grnlip groonga ~/.milkode/db/milkode.db
|
16
22
|
|
23
|
+
If you use UTF-8 database on Windows, you should specify the following option to use multibyte characters:
|
24
|
+
|
25
|
+
> grnlip bin\groonga \Users\myokoym\.milkode\db\milkode.db utf-8
|
26
|
+
|
17
27
|
Then, REPL by Readline for Groonga is started:
|
18
28
|
|
19
29
|
> status
|
data/exe/grnlip
CHANGED
@@ -19,7 +19,10 @@ else
|
|
19
19
|
input_encoding = "utf-8"
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
buffer = ""
|
23
|
+
prompt = ">"
|
24
|
+
|
25
|
+
while line = Readline.readline("groonga(#{basename})#{prompt} ", true)
|
23
26
|
if db_encoding
|
24
27
|
line = line.encode(db_encoding, input_encoding)
|
25
28
|
end
|
@@ -31,10 +34,19 @@ while line = Readline.readline("groonga(#{basename})> ", true)
|
|
31
34
|
pretty_print = true
|
32
35
|
line = line[3..-1]
|
33
36
|
end
|
34
|
-
Tempfile.open(['
|
35
|
-
|
37
|
+
Tempfile.open(['grnlip', '.grn']) do |file|
|
38
|
+
buffer << line
|
39
|
+
file.write(buffer)
|
36
40
|
file.flush
|
37
41
|
response = `#{groonga_exe} #{db_path} < #{file.path}`
|
42
|
+
if response.size.zero?
|
43
|
+
buffer << "\n"
|
44
|
+
prompt = "*"
|
45
|
+
next
|
46
|
+
else
|
47
|
+
buffer = ""
|
48
|
+
prompt = ">"
|
49
|
+
end
|
38
50
|
if db_encoding == "utf-8" and input_encoding != "utf-8"
|
39
51
|
response.force_encoding("utf-8")
|
40
52
|
end
|
data/grnlip.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Masafumi Yokoyama"]
|
10
10
|
spec.email = ["myokoym@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{A
|
12
|
+
spec.summary = %q{A CLI for Groonga using Readline. Supports Windodws.}
|
13
13
|
spec.description = spec.summary
|
14
14
|
spec.homepage = "https://github.com/myokoym/grnlip"
|
15
15
|
spec.license = "MIT"
|
data/lib/grnlip/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grnlip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Yokoyama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description: A
|
41
|
+
description: A CLI for Groonga using Readline. Supports Windodws.
|
42
42
|
email:
|
43
43
|
- myokoym@gmail.com
|
44
44
|
executables:
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- ".travis.yml"
|
51
51
|
- Gemfile
|
52
52
|
- LICENSE.txt
|
53
|
+
- NEWS.md
|
53
54
|
- README.md
|
54
55
|
- Rakefile
|
55
56
|
- bin/console
|
@@ -81,6 +82,6 @@ rubyforge_project:
|
|
81
82
|
rubygems_version: 2.4.5.1
|
82
83
|
signing_key:
|
83
84
|
specification_version: 4
|
84
|
-
summary: A
|
85
|
+
summary: A CLI for Groonga using Readline. Supports Windodws.
|
85
86
|
test_files: []
|
86
87
|
has_rdoc:
|