From b04d439979d773c05ce0179ad295a2118e218c1e Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 16 Apr 2013 21:05:27 +0100 Subject: [PATCH] HTML list: link directly to more sources --- html/index.html.erb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/html/index.html.erb b/html/index.html.erb index 93309518..a643c1c7 100644 --- a/html/index.html.erb +++ b/html/index.html.erb @@ -22,9 +22,13 @@ case package.source when 'github' then recipe['repo'].include?('/') ? "https://github.com/#{recipe['repo']}" : "https://gist.github.com/#{recipe['repo']}" when 'wiki' then recipe.key?('files') ? nil : "http://www.emacswiki.org/emacs/#{package.name}.el" - when 'hg' then - if recipe['url'] =~ /(bitbucket\.org\/[^\/]+\/[^\/\?]+)/ - "https://" + $1 + else + case recipe['url'] + when /(bitbucket\.org\/[^\/]+\/[^\/\?]+)/ then "https://" + $1 + when /(gitorious\.org\/[^\/]+\/[^.]+)/ then "https://" + $1 + when /\A(https?:\/\/code\.google\.com\/p\/[^\/]+\/)/ then $1 + when /\A(https?:\/\/[^.]+\.googlecode\.com\/)/ then $1 + when /\Alp:(.*)/)/ then "https://launchpad.net/" + $1 end end package