groonga-query-log 1.0.9 → 1.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59cb88a84b56af904292b29bd1a4cb9c28325c61
|
4
|
+
data.tar.gz: 92f954ad66d8b38eb2bd36172d083acfa4aea45f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db4ed883687a08851ba4d140dd5974240a0dc5085bb215145ef82f79908edc7be16c8188fe1998e3096d5f1fa0e9ca08569cb416d22cf5290ff8681126d88dda
|
7
|
+
data.tar.gz: 9e78b432f2eec919f7e35d6d7fdb81c55b44b86de1949cf3f2a05236c3be9211bd39f79cc1273d8a052c258f1cc9305bcb61cde46f1e2a6752937ce68dbcbfd2
|
data/doc/text/news.md
CHANGED
@@ -76,42 +76,50 @@ module Groonga
|
|
76
76
|
response1 = $POSTMATCH.chomp
|
77
77
|
when /\Aresponse2: /
|
78
78
|
response2 = $POSTMATCH.chomp
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
puts("failed to parse response1: #{$!.message}")
|
85
|
-
puts(response1)
|
86
|
-
parse_failed = true
|
87
|
-
end
|
79
|
+
next unless valid_entry?(command, response1, response2)
|
80
|
+
report_diff(command, repsponse1, response2)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
88
84
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
85
|
+
def valid_entry?(command, response1, response2)
|
86
|
+
valid = true
|
87
|
+
|
88
|
+
begin
|
89
|
+
JSON.parse(response1)
|
90
|
+
rescue JSON::ParserError
|
91
|
+
puts(command)
|
92
|
+
puts("failed to parse response1: #{$!.message}")
|
93
|
+
puts(response1)
|
94
|
+
valid = false
|
95
|
+
end
|
96
|
+
|
97
|
+
begin
|
98
|
+
JSON.parse(response2)
|
99
|
+
rescue JSON::ParserError
|
100
|
+
puts(command)
|
101
|
+
puts("failed to parse response2: #{$!.message}")
|
102
|
+
puts(response2)
|
103
|
+
valid = false
|
104
|
+
end
|
97
105
|
|
98
|
-
|
106
|
+
valid
|
107
|
+
end
|
99
108
|
|
100
|
-
|
109
|
+
def report_diff(command, response1, response2)
|
110
|
+
return if response1 == response2
|
101
111
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
114
|
-
end
|
112
|
+
base_name = File.basename(path, ".*")
|
113
|
+
Tempfile.open("response1-#{base_name}") do |response1_file|
|
114
|
+
PP.pp(JSON.parse(response1), response1_file)
|
115
|
+
response1_file.flush
|
116
|
+
Tempfile.open("response2-#{base_name}") do |response2_file|
|
117
|
+
PP.pp(JSON.parse(response2), response2_file)
|
118
|
+
response2_file.flush
|
119
|
+
puts(command)
|
120
|
+
system("diff",
|
121
|
+
"-u",
|
122
|
+
response1_file.path, response2_file.path)
|
115
123
|
end
|
116
124
|
end
|
117
125
|
end
|
@@ -232,7 +232,11 @@ module Groonga
|
|
232
232
|
FileUtils.mkdir_p(@database_path.dirname.to_s)
|
233
233
|
system(@groonga, "-n", @database_path.to_s, "quit")
|
234
234
|
grn_files.each do |grn_file|
|
235
|
-
command = [
|
235
|
+
command = [
|
236
|
+
@groonga,
|
237
|
+
"--log-path", log_path.to_s,
|
238
|
+
@database_path.to_s,
|
239
|
+
]
|
236
240
|
command_line = "#{command.join(' ')} < #{grn_file}"
|
237
241
|
puts("Running...: #{command_line}")
|
238
242
|
pid = spawn(*command, :in => grn_file.to_s)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga-query-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: groonga-command-parser
|