groonga-command 1.3.3 → 1.3.4
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 +4 -4
- data/doc/text/news.md +6 -0
- data/lib/groonga/command/base.rb +11 -0
- data/lib/groonga/command/dump.rb +9 -3
- data/lib/groonga/command/load.rb +1 -1
- data/lib/groonga/command/object-remove.rb +1 -1
- data/lib/groonga/command/version.rb +1 -1
- data/test/command/test-dump.rb +18 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cdb331f7fd5eaa6f31d624cf3dac2eb5491b700
|
4
|
+
data.tar.gz: fa8f1163ec3877a7f908626705cc46359e1ee3fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6003c1c54ba204822ece482801863d0929af24d1bdf6fb4623ece0beb5ea77cac18c966635570253c611d73cc515fb9d4945e569ef8e4e0868b424506371d25
|
7
|
+
data.tar.gz: b264a1e44ff983e39f100b7f6400b1c667332f0a7a6c79a86e22a9c82df104045788db3c0bec4539ba7a09a136628c224c532dd04afbecbac4cc8d1d3a0af03d
|
data/doc/text/news.md
CHANGED
data/lib/groonga/command/base.rb
CHANGED
@@ -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
|
data/lib/groonga/command/dump.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
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
|
data/lib/groonga/command/load.rb
CHANGED
data/test/command/test-dump.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
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.
|
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-
|
11
|
+
date: 2017-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|