1
0
Эх сурвалжийг харах

Merge pull request #1555 from MasterEnoc/latex

Add get_latest_version to latex
Simon Legner 4 жил өмнө
parent
commit
336377c249

+ 9 - 0
lib/docs/scrapers/latex.rb

@@ -1,8 +1,10 @@
+# coding: utf-8
 module Docs
   class Latex < UrlScraper
     self.name = 'LaTeX'
     self.slug = 'latex'
     self.type = 'simple'
+    self.release = 'April 2021'
     self.links = {
         home: 'https://ctan.org/pkg/latex2e-help-texinfo/'
     }
@@ -18,5 +20,12 @@ module Docs
       Public Domain Software
     HTML
 
+    def get_latest_version(opts)
+      body = fetch('https://latexref.xyz/', opts)
+      body = body.scan(/\(\w+\s\d+\)/)[0]
+      body.sub!('(', '')
+      body.sub!(')', '')
+    end
+
   end
 end