Explorar o código

haskell: fix get_latest_version

Simon Legner %!s(int64=3) %!d(string=hai) anos
pai
achega
3f4e8ffe14
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      lib/docs/scrapers/haskell.rb

+ 2 - 2
lib/docs/scrapers/haskell.rb

@@ -78,9 +78,9 @@ module Docs
     end
 
     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
-      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]
     end