grnlip 0.1.0 → 0.1.1

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: f534c9d9692b8283653bd6d285ab1bbb47e598f9
4
- data.tar.gz: 562552624434d59da11521569500c81d71070b5d
3
+ metadata.gz: 1f85dad5470eca3d2004d6ad90a58526425a05aa
4
+ data.tar.gz: 0a77c974e96c4917902bfd9e73bc337711a0853d
5
5
  SHA512:
6
- metadata.gz: 3aa2e0058c96b5f87e94cee7896b429e6e87e2f4b2cef59cbc384a03dabddea8f53990e2a81fd81dc9ed4d3eb5a15dc0c1f2547f117bbbe12a838ae8473ca7f7
7
- data.tar.gz: b0b3a49233b7ca545c90722cba0502823a234e74eb83f66ad924434c57c693c567229c9685361ac0690e68c7bf061daa218af86a311ebf89fc248627fc03d0bb
6
+ metadata.gz: 15f559eac17d64e810b5125f7ea9f37ae158da8ced6151977e86ca439c5ae9c0584d1e9f09090f8d0c9edab099acc3306b1130d80f7ea3d9562e686e0fb43db3
7
+ data.tar.gz: bdc23a58bbbf56d5b40e4e89e8f2464bf96a3779964d868ef5488d4fad8975950ea38414f78d60086779921971d437ecbf08d2379789458b22b7e0941d6f0768
data/NEWS.md ADDED
@@ -0,0 +1,13 @@
1
+ # NEWS
2
+
3
+ ## 0.1.1: 2015-12-03
4
+
5
+ ### Changes
6
+
7
+ #### Improvements
8
+
9
+ * Supported multiline input.
10
+
11
+ ## 0.1.0: 2015-12-02
12
+
13
+ Initial release!
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Grnlip
2
2
 
3
- A command line interface for [Groonga](http://groonga.org/).
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
- while line = Readline.readline("groonga(#{basename})> ", true)
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(['readliroonga', '.grn']) do |file|
35
- file.write(line)
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
@@ -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 command line interface for Groonga.}
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"
@@ -1,3 +1,3 @@
1
1
  module Grnlip
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-02 00:00:00.000000000 Z
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 command line interface for Groonga.
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 command line interface for Groonga.
85
+ summary: A CLI for Groonga using Readline. Supports Windodws.
85
86
  test_files: []
86
87
  has_rdoc: