From 2fde00b2506e41f8e90194e51988787e20133e14 Mon Sep 17 00:00:00 2001 From: Nick Klauer Date: Mon, 11 Feb 2019 20:41:05 -0600 Subject: [PATCH 1/2] update homebrew to 2.0.1 --- lib/docs/scrapers/homebrew.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/scrapers/homebrew.rb b/lib/docs/scrapers/homebrew.rb index fba79ec0..b343e4e0 100644 --- a/lib/docs/scrapers/homebrew.rb +++ b/lib/docs/scrapers/homebrew.rb @@ -2,7 +2,7 @@ module Docs class Homebrew < UrlScraper self.name = 'Homebrew' self.type = 'simple' - self.release = '1.8.1' + self.release = '2.0.1' self.base_url = 'https://docs.brew.sh/' self.links = { home: 'https://brew.sh', From 7ad7247878a9e8d5c1dd4fbf4a7e1b5a542eac8c Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 5 Aug 2019 13:18:53 +0200 Subject: [PATCH 2/2] Update version and filter --- lib/docs/filters/homebrew/clean_html.rb | 5 +++++ lib/docs/filters/homebrew/entries.rb | 4 +++- lib/docs/scrapers/homebrew.rb | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/docs/filters/homebrew/clean_html.rb b/lib/docs/filters/homebrew/clean_html.rb index 5bf6aa29..6a81a5c6 100644 --- a/lib/docs/filters/homebrew/clean_html.rb +++ b/lib/docs/filters/homebrew/clean_html.rb @@ -4,6 +4,11 @@ module Docs def call css('hr') + if at_css('h1').nil? + title = current_url.normalized_path[1..-1].gsub(/-/, ' ') + doc.children.before("

#{title}

") + end + css('div.highlighter-rouge').each do |node| lang = node['class'][/language-(\w+)/, 1] node['data-language'] = lang if lang diff --git a/lib/docs/filters/homebrew/entries.rb b/lib/docs/filters/homebrew/entries.rb index 03650ad9..c698cf72 100644 --- a/lib/docs/filters/homebrew/entries.rb +++ b/lib/docs/filters/homebrew/entries.rb @@ -2,7 +2,8 @@ module Docs class Homebrew class EntriesFilter < Docs::EntriesFilter def get_name - name = at_css('h1').content.strip + header = at_css('h1') + name = header.nil? ? current_url.normalized_path[1..-1].gsub(/-/, ' ') : header.content.strip name.remove! %r{\(.*} name end @@ -16,6 +17,7 @@ module Docs Python-for-Formula-Authors Migrating-A-Formula-To-A-Tap Rename-A-Formula + Building-Against-Non-Homebrew-Dependencies How-to-Create-and-Maintain-a-Tap Brew-Test-Bot Prose-Style-Guidelines) diff --git a/lib/docs/scrapers/homebrew.rb b/lib/docs/scrapers/homebrew.rb index faf46a76..5743735f 100644 --- a/lib/docs/scrapers/homebrew.rb +++ b/lib/docs/scrapers/homebrew.rb @@ -2,7 +2,7 @@ module Docs class Homebrew < UrlScraper self.name = 'Homebrew' self.type = 'simple' - self.release = '2.0.1' + self.release = '2.1.9' self.base_url = 'https://docs.brew.sh/' self.links = { home: 'https://brew.sh',