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
4 def call4 def call
5 css('hr')5 css('hr')
6 6
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
7 css('div.highlighter-rouge').each do |node|12 css('div.highlighter-rouge').each do |node|
8 lang = node['class'][/language-(\w+)/, 1]13 lang = node['class'][/language-(\w+)/, 1]
9 node['data-language'] = lang if lang14 node['data-language'] = lang if lang
lib/docs/filters/homebrew/entries.rb+3−1
@@ -2,7 +2,8 @@ module Docs · 1 unmodified line
2 class Homebrew2 class Homebrew
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 def get_name4 def get_name
5 name = at_css('h1').content.strip5 header = at_css('h1')
6 name = header.nil? ? current_url.normalized_path[1..-1].gsub(/-/, ' ') : header.content.strip
6 name.remove! %r{\(.*}7 name.remove! %r{\(.*}
7 name8 name
8 end9 end
@@ -16,6 +17,7 @@ module Docs · 7 unmodified lines
16 Python-for-Formula-Authors17 Python-for-Formula-Authors
17 Migrating-A-Formula-To-A-Tap18 Migrating-A-Formula-To-A-Tap
18 Rename-A-Formula19 Rename-A-Formula
20 Building-Against-Non-Homebrew-Dependencies
19 How-to-Create-and-Maintain-a-Tap21 How-to-Create-and-Maintain-a-Tap
20 Brew-Test-Bot22 Brew-Test-Bot
21 Prose-Style-Guidelines)23 Prose-Style-Guidelines)
lib/docs/scrapers/homebrew.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Homebrew < UrlScraper2 class Homebrew < UrlScraper
3 self.name = 'Homebrew'3 self.name = 'Homebrew'
4 self.type = 'simple'4 self.type = 'simple'
5 self.release = '1.8.1'5 self.release = '2.1.9'
6 self.base_url = 'https://docs.brew.sh/'6 self.base_url = 'https://docs.brew.sh/'
7 self.links = {7 self.links = {
8 home: 'https://brew.sh',8 home: 'https://brew.sh',