Showing the changes to lib/docs/scrapers/cppref/cpp.rb (1 of 10 files). Show all
Unified · Split
| @@ -2,7 +2,6 @@ module Docs · 1 unmodified line | |||
| 2 | class Cpp < Cppref | 2 | class Cpp < Cppref |
| 3 | self.name = 'C++' | 3 | self.name = 'C++' |
| 4 | self.slug = 'cpp' | 4 | self.slug = 'cpp' |
| 5 | self.type = 'c' | ||
| 6 | self.base_url = 'https://en.cppreference.com/w/cpp/' | 5 | self.base_url = 'https://en.cppreference.com/w/cpp/' |
| 7 | 6 | ||
| 8 | html_filters.insert_before 'cppref/clean_html', 'cpp/entries' | 7 | html_filters.insert_before 'cppref/clean_html', 'cpp/entries' |
| @@ -16,13 +15,5 @@ module Docs · 7 unmodified lines | |||
| 16 | regex/regex_token_iterator/operator_cmp.html | 15 | regex/regex_token_iterator/operator_cmp.html |
| 17 | ) | 16 | ) |
| 18 | 17 | ||
| 19 | # Same as get_latest_version in lib/docs/scrapers/c.rb | ||
| 20 | def get_latest_version(opts) | ||
| 21 | doc = fetch_doc('https://en.cppreference.com/w/Cppreference:Archives', opts) | ||
| 22 | link = doc.at_css('a[title^="File:"]') | ||
| 23 | date = link.content.scan(/(\d+)\./)[0][0] | ||
| 24 | DateTime.strptime(date, '%Y%m%d').to_time.to_i | ||
| 25 | end | ||
| 26 | |||
| 27 | end | 18 | end |
| 28 | end | 19 | end |