|
|
@ -78,9 +78,9 @@ module Docs
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def get_latest_version(opts)
|
|
|
|
def get_latest_version(opts)
|
|
|
|
doc = fetch_doc('https://downloads.haskell.org/~ghc/latest/docs/html/', opts)
|
|
|
|
doc = fetch_doc('https://www.haskell.org/ghc/download.html', opts)
|
|
|
|
links = doc.css('a').to_a
|
|
|
|
links = doc.css('a').to_a
|
|
|
|
versions = links.map {|link| link['href'].scan(/ghc-([0-9.]+)/)}
|
|
|
|
versions = links.map {|link| link.content.scan(/\A([0-9.]+)\Z/)}
|
|
|
|
versions.find {|version| !version.empty?}[0][0]
|
|
|
|
versions.find {|version| !version.empty?}[0][0]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|