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: 0419d5711633814c977ad580360a83a79452e0d6
4
- data.tar.gz: eebf8ea3c3c40a6282c97a373cdc9f57069ad3f0
3
+ metadata.gz: 59cb88a84b56af904292b29bd1a4cb9c28325c61
4
+ data.tar.gz: 92f954ad66d8b38eb2bd36172d083acfa4aea45f
5
5
  SHA512:
6
- metadata.gz: 50d316f1fc627b6fd6e7f0bd86e78800b591a9e36a7753a4b2fdd75a1e24f3ffd571b0110cface8befb1b584900241918f37915c99d51b2454d2da6b61a22338
7
- data.tar.gz: 4a5a0545f91800ad90a3d82916c9eb18904105911352c8ea15ae52ddeda1272160543cf17c707b6c20a11a3c28eab68ce0122c708cb84077512eea607401b41c
6
+ metadata.gz: db4ed883687a08851ba4d140dd5974240a0dc5085bb215145ef82f79908edc7be16c8188fe1998e3096d5f1fa0e9ca08569cb416d22cf5290ff8681126d88dda
7
+ data.tar.gz: 9e78b432f2eec919f7e35d6d7fdb81c55b44b86de1949cf3f2a05236c3be9211bd39f79cc1273d8a052c258f1cc9305bcb61cde46f1e2a6752937ce68dbcbfd2
@@ -1,5 +1,12 @@
1
1
  # News
2
2
 
3
+ ## 1.1.0: 2014-10-31
4
+
5
+ ### Improvements
6
+
7
+ * groonga-query-log-run-regression-test: Supported log output on
8
+ loading data.
9
+
3
10
  ## 1.0.9: 2014-09-09
4
11
 
5
12
  ### Improvements
@@ -76,42 +76,50 @@ module Groonga
76
76
  response1 = $POSTMATCH.chomp
77
77
  when /\Aresponse2: /
78
78
  response2 = $POSTMATCH.chomp
79
- parse_failed = false
80
- begin
81
- JSON.parse(response1)
82
- rescue JSON::ParserError
83
- puts(command)
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
- begin
90
- JSON.parse(response2)
91
- rescue JSON::ParserError
92
- puts(command)
93
- puts("failed to parse response2: #{$!.message}")
94
- puts(response2)
95
- parse_failed = true
96
- end
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
- next if parse_failed
106
+ valid
107
+ end
99
108
 
100
- next if response1 == response2
109
+ def report_diff(command, response1, response2)
110
+ return if response1 == response2
101
111
 
102
- base_name = File.basename(path, ".*")
103
- Tempfile.open("response1-#{base_name}") do |response1_file|
104
- PP.pp(JSON.parse(response1), response1_file)
105
- response1_file.flush
106
- Tempfile.open("response2-#{base_name}") do |response2_file|
107
- PP.pp(JSON.parse(response2), response2_file)
108
- response2_file.flush
109
- puts(command)
110
- system("diff",
111
- "-u",
112
- response1_file.path, response2_file.path)
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 = [@groonga, @database_path.to_s]
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)
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Groonga
20
20
  module QueryLog
21
- VERSION = "1.0.9"
21
+ VERSION = "1.1.0"
22
22
  end
23
23
  end
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.9
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-09-09 00:00:00.000000000 Z
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