groonga-command 1.3.3 → 1.3.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: 346b76e2d8b59edb0e883fad7d41d1f3b5efa001
4
- data.tar.gz: 147a81ade996d83ee49b4741595627a25310c298
3
+ metadata.gz: 7cdb331f7fd5eaa6f31d624cf3dac2eb5491b700
4
+ data.tar.gz: fa8f1163ec3877a7f908626705cc46359e1ee3fd
5
5
  SHA512:
6
- metadata.gz: b0e445df5d92a6d6b760460f6322921ea8fa2ae283c692283922f5e13e7d4d7249cd0edccdad2ddc82d2b448f822b2351bd3f066dac9fdd5d83c8ff383ff7add
7
- data.tar.gz: dcdcf5e462840cbd02ee28f7b0f40ec4a44eeec74f9698d958374c985b5bdcc4891ddd2c66a3dddf88ebe1a975f59eec9880f42d66b91ee8ab578f5a75cda6a0
6
+ metadata.gz: d6003c1c54ba204822ece482801863d0929af24d1bdf6fb4623ece0beb5ea77cac18c966635570253c611d73cc515fb9d4945e569ef8e4e0868b424506371d25
7
+ data.tar.gz: b264a1e44ff983e39f100b7f6400b1c667332f0a7a6c79a86e22a9c82df104045788db3c0bec4539ba7a09a136628c224c532dd04afbecbac4cc8d1d3a0af03d
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.3.4: 2017-07-31
4
+
5
+ ### Improvements
6
+
7
+ * {Groonga::Command::Dump#sort_hash_table}: Added.
8
+
3
9
  ## 1.3.3: 2017-06-25
4
10
 
5
11
  ### Improvements
@@ -216,6 +216,17 @@ module Groonga
216
216
  return nil if value.nil?
217
217
  value.strip.split(/\s*[| ]\s*/)
218
218
  end
219
+
220
+ def boolean_value(name, default_value)
221
+ parse_boolean_value(self[name], default_value)
222
+ end
223
+
224
+ def parse_boolean_value(value, default_value)
225
+ return default_value if value.nil?
226
+ value = value.strip
227
+ return default_value if value.empty?
228
+ value == "yes"
229
+ end
219
230
  end
220
231
  end
221
232
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013-2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2013-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
@@ -34,6 +32,7 @@ module Groonga
34
32
  :dump_records,
35
33
  :dump_indexes,
36
34
  :dump_configs,
35
+ :sort_hash_table,
37
36
  ]
38
37
  end
39
38
  end
@@ -43,6 +42,13 @@ module Groonga
43
42
  def output_type
44
43
  :none
45
44
  end
45
+
46
+ # @return [Boolean] `true` if `sort_hash_table` value is `"yes"`.
47
+ #
48
+ # @since 1.3.4
49
+ def sort_hash_table?
50
+ boolean_value(:sort_hash_table, false)
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -63,7 +63,7 @@ module Groonga
63
63
  #
64
64
  # @since 1.3.0
65
65
  def output_ids?
66
- self[:output_ids] == "yes"
66
+ boolean_value(:output_ids, false)
67
67
  end
68
68
 
69
69
  private
@@ -48,7 +48,7 @@ module Groonga
48
48
  #
49
49
  # @since 1.1.7
50
50
  def force?
51
- self[:force] == "yes"
51
+ boolean_value(:force, false)
52
52
  end
53
53
  end
54
54
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Groonga
18
18
  module Command
19
- VERSION = "1.3.3"
19
+ VERSION = "1.3.4"
20
20
  end
21
21
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013-2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2013-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
@@ -30,6 +28,7 @@ class DumpCommandTest < Test::Unit::TestCase
30
28
  dump_records = "no"
31
29
  dump_indexes = "yes"
32
30
  dump_configs = "no"
31
+ sort_hash_table = "yes"
33
32
 
34
33
  command = dump_command({},
35
34
  [
@@ -39,6 +38,7 @@ class DumpCommandTest < Test::Unit::TestCase
39
38
  dump_records,
40
39
  dump_indexes,
41
40
  dump_configs,
41
+ sort_hash_table,
42
42
  ])
43
43
  assert_equal({
44
44
  :tables => tables,
@@ -47,6 +47,7 @@ class DumpCommandTest < Test::Unit::TestCase
47
47
  :dump_records => dump_records,
48
48
  :dump_indexes => dump_indexes,
49
49
  :dump_configs => dump_configs,
50
+ :sort_hash_table => sort_hash_table,
50
51
  },
51
52
  command.arguments)
52
53
  end
@@ -57,4 +58,18 @@ class DumpCommandTest < Test::Unit::TestCase
57
58
  assert_equal(:none, dump_command.output_type)
58
59
  end
59
60
  end
61
+
62
+ class SortHashTableTest < self
63
+ def test_default
64
+ assert do
65
+ not dump_command.sort_hash_table?
66
+ end
67
+ end
68
+
69
+ def test_yes
70
+ assert do
71
+ dump_command("sort_hash_table" => "yes").sort_hash_table?
72
+ end
73
+ end
74
+ end
60
75
  end
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.3
4
+ version: 1.3.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: 2017-06-25 00:00:00.000000000 Z
11
+ date: 2017-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json