Navigation Menu

Skip to content

Commit

Permalink
Ignore whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 28, 2015
1 parent 6f6c71d commit 66a855b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/droonga/timestamp.rb
Expand Up @@ -30,6 +30,7 @@ def stringify(timestamp)

def last_message_timestamp=(timestamp)
if timestamp.is_a?(String)
timestamp = timestamp.strip
if timestamp.empty?
timestamp = nil
else
Expand All @@ -49,7 +50,7 @@ def last_message_timestamp=(timestamp)
def last_message_timestamp
file = Path.last_message_timestamp
return nil unless file.exist?
timestamp = file.read
timestamp = file.read.strip
return nil if timestamp.nil? or timestamp.empty?
Time.parse(timestamp)
end
Expand Down

0 comments on commit 66a855b

Please sign in to comment.