git clone git://github.com/al3x/git-wiki.git
merge changes from schacon
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
def require_gem_with_feedback(gem) begin require gem rescue LoadError puts "You need to 'sudo gem install #{gem}' before we can proceed" endend class String def wiki_linked self.gsub!(/\b((?:[A-Z]\w+){2,})/) { |m| "<a href=\"/#{m}\">#{m}</a>" } self.gsub!(/\[(\w+){2,}\]/) { |m| m.gsub!(/(\[|\])/, '') "<a href=\"/#{m}\">#{m}</a>" } self endend class Time def for_time_ago_in_words "#{(self.to_i * 1000)}" endend