History

composer: finish scraper and filters

Jasper van Merle committed 7 years ago

Commit ce5f1821 parent a1c8ed23 files · +8 −10Browse files

Unified · Split

3 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +2 −2
  2. lib/docs/filters/composer/entries.rb +0 −3
  3. lib/docs/scrapers/composer.rb +6 −5
assets/javascripts/templates/pages/about_tmpl.coffee+2−2
@@ -188,9 +188,9 @@ credits = [ · 187 unmodified lines
188 'https://raw.githubusercontent.com/jashkenas/coffeescript/master/LICENSE'188 'https://raw.githubusercontent.com/jashkenas/coffeescript/master/LICENSE'
189 ], [189 ], [
190 'Composer',190 'Composer',
191 '2012-2018 Nils Adermann, Jordi Boggiano',191 'Nils Adermann, Jordi Boggiano',
192 'MIT',192 'MIT',
193 'https://github.com/composer/composer/blob/master/LICENSE'193 'https://raw.githubusercontent.com/composer/composer/master/LICENSE'
194 ], [194 ], [
195 'Cordova',195 'Cordova',
196 '2012-2018 The Apache Software Foundation',196 '2012-2018 The Apache Software Foundation',
lib/docs/filters/composer/entries.rb+0−3
@@ -3,15 +3,12 @@ module Docs · 2 unmodified lines
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 def get_name4 def get_name
5 title = at_css('h1').content5 title = at_css('h1').content
6
7 title = "#{Integer(subpath[1]) + 1}. #{title}" if type == 'Book'6 title = "#{Integer(subpath[1]) + 1}. #{title}" if type == 'Book'
8
9 title7 title
10 end8 end
11 9
12 def get_type10 def get_type
13 return 'Articles' if subpath.start_with?('articles/')11 return 'Articles' if subpath.start_with?('articles/')
14
15 'Book'12 'Book'
16 end13 end
17 14
lib/docs/scrapers/composer.rb+6−5
@@ -1,8 +1,8 @@
1module Docs1module Docs
2 class Composer < UrlScraper2 class Composer < UrlScraper
3 self.name = 'Composer'
4 self.type = 'simple'3 self.type = 'simple'
5 4 self.release = '1.9.0'
5 self.base_url = 'https://getcomposer.org/doc/'
6 self.links = {6 self.links = {
7 home: 'https://getcomposer.org',7 home: 'https://getcomposer.org',
8 code: 'https://github.com/composer/composer'8 code: 'https://github.com/composer/composer'
@@ -10,9 +10,6 @@ module Docs · 1 unmodified line
10 10
11 html_filters.push 'composer/clean_html', 'composer/entries'11 html_filters.push 'composer/clean_html', 'composer/entries'
12 12
13 self.release = '1.7.2'
14 self.base_url = 'https://getcomposer.org/doc/'
15
16 options[:container] = '#main'13 options[:container] = '#main'
17 14
18 options[:skip_patterns] = [15 options[:skip_patterns] = [
@@ -23,5 +20,9 @@ module Docs · 4 unmodified lines
23 &copy; Nils Adermann, Jordi Boggiano<br>20 &copy; Nils Adermann, Jordi Boggiano<br>
24 Licensed under the MIT License.21 Licensed under the MIT License.
25 HTML22 HTML
23
24 def get_latest_version(opts)
25 get_latest_github_release('composer', 'composer', opts)
26 end
26 end27 end
27end28end