groonga-client 0.1.6 → 0.1.7

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: 085dda6ce4c3f7375c8960739d2afc0ea48c022f
4
- data.tar.gz: d276c04e190b17811dc17eeb463642bbcef6dae4
3
+ metadata.gz: 730d0d465dfa172d63dc072c41da07393bac121c
4
+ data.tar.gz: 2feb754e982010f661b038ba7dbfc24c65391ce1
5
5
  SHA512:
6
- metadata.gz: 2bdec00ae8c07fe0ff8194277358176170d96b409cb9b32e73777be5cb3fa305b17a6c9067d56f0c952837b2d4f7807aa9260710b8834f39ee7c5ca9fb7789dd
7
- data.tar.gz: dde1e186a36cb02738cf9321130a3ec369116f14848db580df3cffff0a008bca80f2df98529ee08c082eeebc006f7244da06280ae56717fd80ad8f442fecded8
6
+ metadata.gz: 82f16e4c99ff5d2df6bb359502ef877cbe7d8366d086303c8af17af1eec5742119812f06e75f23fcf01852bf1ada1ead65d572949bcf4467150b41fcfe3097f1
7
+ data.tar.gz: 44e907e66266757ca60262b32ebca650e361c40930aee2bd53881c54909faa7c0bc4354a4167627f6bcf721be49e2c36c95493da4171700d7fe5fde61a4468e8
data/doc/text/news.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # NEWS
2
2
 
3
+ ## 0.1.7 - 2015-07-08
4
+
5
+ ### Improvements
6
+
7
+ * select: Avoided response value isn't accessible by response column
8
+ name duplication. Data access key for duplicated column name has
9
+ `2`, `3`, ... suffix such as `html_escape2` and `html_escape3`.
10
+ [groonga-dev,03348][Reported by Hiroyuki Sato]
11
+
12
+ ### Thanks
13
+
14
+ * Hiroyuki Sato
15
+
3
16
  ## 0.1.6 - 2015-06-10
4
17
 
5
18
  ### Fixes
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
2
2
  # Copyright (C) 2013 Kosuke Asami
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
@@ -43,7 +43,17 @@ module Groonga
43
43
 
44
44
  def parse_result(raw_result)
45
45
  n_hits = raw_result.first.first
46
- properties = raw_result[1]
46
+ column_names = {}
47
+ properties = raw_result[1].collect do |column_name, column_type|
48
+ base_column_name = column_name
49
+ suffix = 2
50
+ while column_names.key?(column_name)
51
+ column_name = "#{base_column_name}#{suffix}"
52
+ suffix += 1
53
+ end
54
+ column_names[column_name] = true
55
+ [column_name, column_type]
56
+ end
47
57
  infos = raw_result[2..-1] || []
48
58
  items = infos.collect do |info|
49
59
  item = {}
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Groonga
20
20
  class Client
21
- VERSION = "0.1.6"
21
+ VERSION = "0.1.7"
22
22
  end
23
23
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
2
2
  # Copyright (C) 2013 Kosuke Asami
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
@@ -54,6 +54,31 @@ class TestResponseSelect < Test::Unit::TestCase
54
54
  records([[[1], [["updated_at", "Time"]], [updated_at]]]))
55
55
  end
56
56
 
57
+ def test_duplicated_column_name
58
+ assert_equal([
59
+ {
60
+ "html_escape" => "content1",
61
+ "html_escape2" => "content2",
62
+ "html_escape3" => "content3",
63
+ }
64
+ ],
65
+ records([
66
+ [
67
+ [1],
68
+ [
69
+ ["html_escape", nil],
70
+ ["html_escape", nil],
71
+ ["html_escape", nil],
72
+ ],
73
+ [
74
+ "content1",
75
+ "content2",
76
+ "content3",
77
+ ],
78
+ ]
79
+ ]))
80
+ end
81
+
57
82
  private
58
83
  def records(body)
59
84
  create_response(body).records
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Haruka Yoshihara
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-06-10 00:00:00.000000000 Z
13
+ date: 2015-07-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: gqtp
@@ -233,18 +233,18 @@ specification_version: 4
233
233
  summary: Groonga-client is a client for groonga (http://groonga.org/) implemented
234
234
  with pure ruby.
235
235
  test_files:
236
- - test/protocol/test-http.rb
237
- - test/protocol/test-gqtp.rb
238
- - test/response/test-error.rb
239
- - test/response/test-select.rb
240
- - test/response/test-table-list.rb
241
- - test/response/test-column-list.rb
242
- - test/response/helper.rb
243
- - test/response/test-base.rb
244
- - test/response/test-status.rb
245
236
  - test/results/test-table-list.rb
246
237
  - test/results/test-column-list.rb
247
238
  - test/test-command.rb
248
239
  - test/run-test.rb
249
240
  - test/test-client.rb
241
+ - test/protocol/test-gqtp.rb
242
+ - test/protocol/test-http.rb
243
+ - test/response/test-table-list.rb
244
+ - test/response/test-error.rb
245
+ - test/response/test-base.rb
246
+ - test/response/test-status.rb
247
+ - test/response/test-select.rb
248
+ - test/response/helper.rb
249
+ - test/response/test-column-list.rb
250
250
  has_rdoc: