groonga-command-parser 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d15b5c7601c61b757b5f422f0edb1f8fb49f904a
4
- data.tar.gz: 6bb40d256f229dbf2e99884facc76d6dc1da11f4
3
+ metadata.gz: fc1137f8b33fe61df8ac7114fef57a710dc7e663
4
+ data.tar.gz: 0d2cd08ee3bb181de0183c23c1929b763664ab4d
5
5
  SHA512:
6
- metadata.gz: 618025a3101618ce4d4dde8074158c765faa4c179de98019a2375f66419e3849a5dcec40c59a9e5d0b3230ac2a875b1b6dda7247f2dd17ca7a4fb2f9f4d1cfcf
7
- data.tar.gz: 6a5f6f60e9e002bdf64949af7dbe5fb6c229b864608f695256111d2d0e1da99792e48b2c560b0721e5bdd2943d93bc7b08b9621657c5d764dc19d5d90ac15888
6
+ metadata.gz: c2217aa7ee7d188241a34e195fa6701a948865876f59338a6f7656ccd59890d9c1b8ecc9c8eb4184a4df85204a25223cb83b1c80daa989f36f672a2ac926e0cb
7
+ data.tar.gz: c3c71271c60d6cc44a14b3c707bcd21ce10565f6c67f03ccc4020e444ef535614f42e9b128eaa356fd095592600428a37a68f2aa59c5996750d0a33202b99bde
@@ -1,5 +1,12 @@
1
1
  # News
2
2
 
3
+ ## 1.1.4: 2019-03-26
4
+
5
+ ### Fixes
6
+
7
+ * Fixed a bug that can't convert to the Elasticsearch format
8
+ when a "load" command hasn't option name of "--value"
9
+
3
10
  ## 1.1.3: 2019-03-22
4
11
 
5
12
  ### Improvements
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2014-2019 Kouhei Sutou <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -86,6 +86,7 @@ module Groonga
86
86
  "Currently, we can specify 5, 6, 7, and 8" +
87
87
  " in this option",
88
88
  "Available only in elasticsearch format",
89
+ Integer,
89
90
  "[#{@elasticsearch_version}]") do |version|
90
91
  @elasticsearch_version = version
91
92
  end
@@ -94,9 +95,24 @@ module Groonga
94
95
  end
95
96
 
96
97
  def convert(input)
97
- parser = Parser.new
98
- parser.on_command do |command|
99
- puts(convert_format(command))
98
+ parser = Parser.new(need_original_source: false)
99
+ case @format
100
+ when :elasticsearch
101
+ parser.on_load_columns do |command, columns|
102
+ command[:columns] ||= columns.join(",")
103
+ end
104
+ loaded_values = []
105
+ parser.on_load_value do |command, value|
106
+ loaded_values << value
107
+ end
108
+ parser.on_load_complete do |command|
109
+ command[:values] = JSON.generate(loaded_values)
110
+ puts(convert_format(command))
111
+ end
112
+ else
113
+ parser.on_command do |command|
114
+ puts(convert_format(command))
115
+ end
100
116
  end
101
117
  input.each_line do |line|
102
118
  parser << line
@@ -17,7 +17,7 @@
17
17
  module Groonga
18
18
  module Command
19
19
  class Parser
20
- VERSION = "1.1.3"
20
+ VERSION = "1.1.4"
21
21
  end
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-command-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-22 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: groonga-command