Navigation Menu

Skip to content

Commit

Permalink
Use the same variable name for option name
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 23, 2014
1 parent 8b85483 commit 8276256
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/groonga/query-log/command/show-running-queries.rb
Expand Up @@ -25,7 +25,7 @@ module QueryLog
module Command
class ShowRunningQueries
def initialize
@timestamp = nil
@base_time = nil
end

def run(command_line)
Expand All @@ -49,8 +49,8 @@ def create_parser
parser.on("--base-time=TIME",
"Show running queries at TIME",
"You can use popular time format for TIME such as W3C-DTF",
"(now)") do |timestamp|
@timestamp = Time.parse(timestamp)
"(now)") do |base_time|
@base_time = Time.parse(base_time)
end
end

Expand All @@ -60,9 +60,9 @@ def each_parsing_statistic(input_paths)
input_paths.each do |input_path|
File.open(input_path) do |input|
parser.parse(input) do |statistic|
next if @timestamp.nil?
next if statistic.start_time < @timestamp
if statistic.start_time == @timestamp
next if @base_time.nil?
next if statistic.start_time < @base_time
if statistic.start_time == @base_time
yield(statistic)
end
throw(tag)
Expand Down

0 comments on commit 8276256

Please sign in to comment.