Add get_latest_version to latex
Unified · Split
| @@ -1,8 +1,10 @@ | |||
| 1 | # coding: utf-8 | ||
| 1 | module Docs | 2 | module Docs |
| 2 | class Latex < UrlScraper | 3 | class Latex < UrlScraper |
| 3 | self.name = 'LaTeX' | 4 | self.name = 'LaTeX' |
| 4 | self.slug = 'latex' | 5 | self.slug = 'latex' |
| 5 | self.type = 'simple' | 6 | self.type = 'simple' |
| 7 | self.release = 'April 2021' | ||
| 6 | self.links = { | 8 | self.links = { |
| 7 | home: 'https://ctan.org/pkg/latex2e-help-texinfo/' | 9 | home: 'https://ctan.org/pkg/latex2e-help-texinfo/' |
| 8 | } | 10 | } |
| @@ -18,5 +20,12 @@ module Docs · 9 unmodified lines | |||
| 18 | Public Domain Software | 20 | Public Domain Software |
| 19 | HTML | 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 | end | 30 | end |
| 22 | end | 31 | end |