More concise code for recipe source URL

This commit is contained in:
Steve Purcell 2012-12-25 09:20:59 +00:00
parent 39de7629d7
commit e5c5783701

View file

@ -28,11 +28,11 @@
descr, source = $1, $3 descr, source = $1, $3
end end
case source source_url =
when 'github' then source_url = "https://github.com/#{recipe['repo']}" case source
when 'wiki' then source_url = recipe.key?('files') ? nil : "http://www.emacswiki.org/emacs/#{pkgname}.el" when 'github' then "https://github.com/#{recipe['repo']}"
else source_url = nil when 'wiki' then recipe.key?('files') ? nil : "http://www.emacswiki.org/emacs/#{pkgname}.el"
end end
["<a name=\"#{pkgname}\"></a>[#{pkgname}](#{pkgurl})", version, descr, "[recipe](#{recipe_url})", source_url ? "[#{source}](#{source_url})" : ""] ["<a name=\"#{pkgname}\"></a>[#{pkgname}](#{pkgurl})", version, descr, "[recipe](#{recipe_url})", source_url ? "[#{source}](#{source_url})" : ""]
end end