History

haskell: fix get_latest_version

Simon Legner committed 4 years ago

Commit 3f4e8ff1 parent 02444cf1 file · +2 −2Browse files

Unified · Split

lib/docs/scrapers/haskell.rb+2−2
@@ -78,9 +78,9 @@ module Docs · 77 unmodified lines
78 end78 end
79 79
80 def get_latest_version(opts)80 def get_latest_version(opts)
81 doc = fetch_doc('https://downloads.haskell.org/~ghc/latest/docs/html/', opts)81 doc = fetch_doc('https://www.haskell.org/ghc/download.html', opts)
82 links = doc.css('a').to_a82 links = doc.css('a').to_a
83 versions = links.map {|link| link['href'].scan(/ghc-([0-9.]+)/)}83 versions = links.map {|link| link.content.scan(/\A([0-9.]+)\Z/)}
84 versions.find {|version| !version.empty?}[0][0]84 versions.find {|version| !version.empty?}[0][0]
85 end85 end
86 86