groonga-command 1.3.4 → 1.3.5

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
- SHA1:
3
- metadata.gz: 7cdb331f7fd5eaa6f31d624cf3dac2eb5491b700
4
- data.tar.gz: fa8f1163ec3877a7f908626705cc46359e1ee3fd
2
+ SHA256:
3
+ metadata.gz: 5a4f78fab492909add50d825ad9e8545fec6e3c23fa552946ed8f4a15ef49e7a
4
+ data.tar.gz: 462abef327588d8440b41ac634714ad0cc7209ba46efd96b1c32f79b9f7ee7d3
5
5
  SHA512:
6
- metadata.gz: d6003c1c54ba204822ece482801863d0929af24d1bdf6fb4623ece0beb5ea77cac18c966635570253c611d73cc515fb9d4945e569ef8e4e0868b424506371d25
7
- data.tar.gz: b264a1e44ff983e39f100b7f6400b1c667332f0a7a6c79a86e22a9c82df104045788db3c0bec4539ba7a09a136628c224c532dd04afbecbac4cc8d1d3a0af03d
6
+ metadata.gz: 8abeea1c3ccde4309240e67b0f6853211911ca0a6093c4e1314d08a58a23a051515935db318875c6bab0591bd432e98db082cf4ffcc86094a1492f1ccac72012
7
+ data.tar.gz: ba24c65f52dd84208e0afcd4d96b5aa22b63feae8efda2e449cec94167b251aeb4d41fe0014f4e46d71e108e7b45cef2d4af72338310474d83921772700623d4
@@ -1,5 +1,13 @@
1
1
  # News
2
2
 
3
+ ## 1.3.5: 2018-05-21
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::Base#to_s}: Added.
8
+
9
+ * {Groonga::Command::Load#table}: Added.
10
+
3
11
  ## 1.3.4: 2017-07-31
4
12
 
5
13
  ### Improvements
@@ -153,6 +153,14 @@ module Groonga
153
153
  format.command_line(options)
154
154
  end
155
155
 
156
+ def to_s
157
+ if uri_format?
158
+ to_uri_format
159
+ else
160
+ to_command_format
161
+ end
162
+ end
163
+
156
164
  private
157
165
  def construct_arguments(pair_arguments, ordered_arguments)
158
166
  arguments = {}
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -43,14 +41,23 @@ module Groonga
43
41
 
44
42
  Command.register(command_name, self)
45
43
 
44
+ attr_writer :table
46
45
  attr_writer :values
47
46
  attr_writer :columns
48
47
  def initialize(*argumetns)
49
48
  super
49
+ @table = nil
50
50
  @values = nil
51
51
  @columns = nil
52
52
  end
53
53
 
54
+ # @return [String] The table name to be loaded.
55
+ #
56
+ # @since 1.3.5
57
+ def table
58
+ @table ||= self[:table]
59
+ end
60
+
54
61
  def values
55
62
  @values ||= parse_values(self[:values])
56
63
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Groonga
18
18
  module Command
19
- VERSION = "1.3.4"
19
+ VERSION = "1.3.5"
20
20
  end
21
21
  end
@@ -122,6 +122,30 @@ select \\
122
122
  end
123
123
  end
124
124
 
125
+ sub_test_case("#to_s") do
126
+ def setup
127
+ @table = "Users"
128
+ @select = Groonga::Command::Base.new("select", :table => @table)
129
+ end
130
+
131
+ def test_uri_format
132
+ @select.original_format = :uri
133
+ assert_equal(@select.to_uri_format,
134
+ @select.to_s)
135
+ end
136
+
137
+ def test_command_format
138
+ @select.original_format = :command
139
+ assert_equal(@select.to_command_format,
140
+ @select.to_s)
141
+ end
142
+
143
+ def test_default
144
+ assert_equal(@select.to_command_format,
145
+ @select.to_s)
146
+ end
147
+ end
148
+
125
149
  sub_test_case("#[]") do
126
150
  def setup
127
151
  @table = "Users"
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -56,6 +54,18 @@ class LoadCommandTest < Test::Unit::TestCase
56
54
  end
57
55
  end
58
56
 
57
+ class TableTest < self
58
+ def test_nil
59
+ command = load_command
60
+ assert_nil(command.table)
61
+ end
62
+
63
+ def test_specified
64
+ command = load_command(:table => "Users")
65
+ assert_equal("Users", command.table)
66
+ end
67
+ end
68
+
59
69
  class ValuesTest < self
60
70
  def test_nil
61
71
  command = load_command
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-command
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-31 00:00:00.000000000 Z
11
+ date: 2018-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
268
  version: '0'
269
269
  requirements: []
270
270
  rubyforge_project:
271
- rubygems_version: 2.5.2
271
+ rubygems_version: 2.7.7
272
272
  signing_key:
273
273
  specification_version: 4
274
274
  summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s