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