Add get_latest_version to latex
Unified · Split
| @@ -1,8 +1,10 @@ | ||
| 1 | +# coding: utf-8 | |
| 1 | 2 | module Docs |
| 2 | 3 | class Latex < UrlScraper |
| 3 | 4 | self.name = 'LaTeX' |
| 4 | 5 | self.slug = 'latex' |
| 5 | 6 | self.type = 'simple' |
| 7 | + self.release = 'April 2021' | |
| 6 | 8 | self.links = { |
| 7 | 9 | home: 'https://ctan.org/pkg/latex2e-help-texinfo/' |
| 8 | 10 | } |
| @@ -18,5 +20,12 @@ module Docs · 9 unmodified lines | ||
| 18 | 20 | Public Domain Software |
| 19 | 21 | HTML |
| 20 | 22 | |
| 23 | + def get_latest_version(opts) | |
| 24 | + body = fetch('https://latexref.xyz/', opts) | |
| 25 | + body = body.scan(/\(\w+\s\d+\)/)[0] | |
| 26 | + body.sub!('(', '') | |
| 27 | + body.sub!(')', '') | |
| 28 | + end | |
| 29 | + | |
| 21 | 30 | end |
| 22 | 31 | end |