Permalink
Browse files

Did you know that /./ means any character? I did, but forgot to handl…

…e it anyway
  • Loading branch information...
cschneid committed Feb 24, 2011
1 parent 3fe7536 commit 87d1980029308813431ee2f92e66a0a2f97b017c
Showing with 3 additions and 3 deletions.
  1. +3 −3 irclogger.rb
View
@@ -37,7 +37,7 @@ def info?
def self.find_by_channel_and_date(channel, date)
# Channels look like: .sinatra, or ..Paws. Sub it so it finds in the db right.
- channel = channel.gsub(".", "#")
+ channel = channel.gsub(/\./, "#")
day_after = date + 1
@@ -145,7 +145,7 @@ def plain_entry(message)
get '/:channel/slice/:from/:to' do
@channel = params[:channel]
- @channel = @channel.gsub(".", "#")
+ @channel = @channel.gsub(/\./, "#")
@messages = Message.filter(:timestamp > params[:from]).
filter(:timestamp < params[:to]).
filter(:channel => "#{@channel}").
@@ -170,7 +170,7 @@ def plain_entry(message)
arr << row[:channel] if (row[:channel] =~ /^#/ && row[:channel] != "#datamapper http://datamapper.")
arr
}.collect do |channel|
- channel = channel.gsub(".", "#")
+ channel = channel.gsub(/\./, "#")
{
:channel => channel,
:permalink => "http://irclogger.com/#{channel[1..-1]}"

0 comments on commit 87d1980

Please sign in to comment.