History

Update Homebrew to 2.0.1 (#978)

Update Homebrew to 2.0.1

Jasper van Merle committed 7 years ago

Commit 5f5ac5b2 parents 836f9e1 7ad72473 files · +9 −2Browse files

Unified · Split

3 files
  1. lib/docs/filters/homebrew/clean_html.rb +5 −0
  2. lib/docs/filters/homebrew/entries.rb +3 −1
  3. lib/docs/scrapers/homebrew.rb +1 −1
lib/docs/filters/homebrew/clean_html.rb+5−0
@@ -4,6 +4,11 @@ module Docs · 3 unmodified lines
44 def call
55 css('hr')
66
7+ if at_css('h1').nil?
8+ title = current_url.normalized_path[1..-1].gsub(/-/, ' ')
9+ doc.children.before("<h1>#{title}</h1>")
10+ end
11+
712 css('div.highlighter-rouge').each do |node|
813 lang = node['class'][/language-(\w+)/, 1]
914 node['data-language'] = lang if lang
lib/docs/filters/homebrew/entries.rb+3−1
@@ -2,7 +2,8 @@ module Docs · 1 unmodified line
22 class Homebrew
33 class EntriesFilter < Docs::EntriesFilter
44 def get_name
5− name = at_css('h1').content.strip
5+ header = at_css('h1')
6+ name = header.nil? ? current_url.normalized_path[1..-1].gsub(/-/, ' ') : header.content.strip
67 name.remove! %r{\(.*}
78 name
89 end
@@ -16,6 +17,7 @@ module Docs · 7 unmodified lines
1617 Python-for-Formula-Authors
1718 Migrating-A-Formula-To-A-Tap
1819 Rename-A-Formula
20+ Building-Against-Non-Homebrew-Dependencies
1921 How-to-Create-and-Maintain-a-Tap
2022 Brew-Test-Bot
2123 Prose-Style-Guidelines)
lib/docs/scrapers/homebrew.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Homebrew < UrlScraper
33 self.name = 'Homebrew'
44 self.type = 'simple'
5− self.release = '1.8.1'
5+ self.release = '2.1.9'
66 self.base_url = 'https://docs.brew.sh/'
77 self.links = {
88 home: 'https://brew.sh',