Commit 9863d3e97bf0753f62194eb48d4233920d41dcd5

Authored by Leandro Nunes dos Santos
1 parent e69c983e

do not process strftime strings in updatepo command

app/models/spammer_logger.rb
... ... @@ -5,10 +5,10 @@ class SpammerLogger < Logger
5 5 def self.log(spammer_ip, object=nil)
6 6 if object
7 7 if object.kind_of?(Comment)
8   - @logger << "[#{Time.now.strftime("%F %T %z")}] Comment-id: #{object.id} IP: #{spammer_ip}\n"
  8 + @logger << "[#{Time.now.strftime('%F %T %z')}] Comment-id: #{object.id} IP: #{spammer_ip}\n"
9 9 end
10 10 else
11   - @logger << "[#{Time.now.strftime("%F %T %z")}] IP: #{spammer_ip}\n"
  11 + @logger << "[#{Time.now.strftime('%F %T %z')}] IP: #{spammer_ip}\n"
12 12 end
13 13 end
14 14  
... ...
plugins/spaminator/lib/spaminator_plugin/spaminator.rb
... ... @@ -15,12 +15,12 @@ class SpaminatorPlugin::Spaminator
15 15 def initialize_logger(environment)
16 16 logdir = File.join(RAILS_ROOT, 'log', SpaminatorPlugin.name.underscore)
17 17 File.makedirs(logdir) if !File.exist?(logdir)
18   - logpath = File.join(logdir, "#{environment.name.to_slug}_#{ENV['RAILS_ENV']}_#{Time.now.strftime("%F_%T")}.log")
  18 + logpath = File.join(logdir, "#{environment.name.to_slug}_#{ENV['RAILS_ENV']}_#{Time.now.strftime('%F_%T')}.log")
19 19 @logger = Logger.new(logpath)
20 20 end
21 21  
22 22 def log(message)
23   - @logger << "[#{Time.now.strftime("%F %T %z")}] #{message}\n"
  23 + @logger << "[#{Time.now.strftime('%F %T %z')}] #{message}\n"
24 24 end
25 25 end
26 26  
... ...