History

jest: finish update

Jasper van Merle committed 7 years ago

Commit b1ab6741 parent 24901363 files · +17 −9Browse files

Unified · Split

3 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +2 −2
  2. lib/docs/filters/jest/entries.rb +11 −3
  3. lib/docs/scrapers/jest.rb +4 −4
assets/javascripts/templates/pages/about_tmpl.coffee+2−2
@@ -354,8 +354,8 @@ credits = [ · 353 unmodified lines
354 'https://raw.githubusercontent.com/jekyll/jekyll/master/LICENSE'354 'https://raw.githubusercontent.com/jekyll/jekyll/master/LICENSE'
355 ], [355 ], [
356 'Jest',356 'Jest',
357 '2014-present Facebook Inc.',357 'Facebook, Inc. and its affiliates.',
358 'BSD',358 'MIT',
359 'https://raw.githubusercontent.com/facebook/jest/master/LICENSE'359 'https://raw.githubusercontent.com/facebook/jest/master/LICENSE'
360 ], [360 ], [
361 'jQuery',361 'jQuery',
lib/docs/filters/jest/entries.rb+11−3
@@ -20,15 +20,23 @@ module Docs · 19 unmodified lines
20 def additional_entries20 def additional_entries
21 return [] unless !root_page? && self.type == self.name # api page21 return [] unless !root_page? && self.type == self.name # api page
22 22
23 at_css('.mainContainer ul').css('li > a').map do |node|23 entries = []
24 name = node.at_css('code').content.strip24
25 at_css('.mainContainer ul').css('li > a').each do |node|
26 code = node.at_css('code')
27 next if code.nil?
28
29 name = code.content.strip
25 name.sub! %r{\(.*\)}, '()'30 name.sub! %r{\(.*\)}, '()'
26 name.remove! %r{[\s=<].*}31 name.remove! %r{[\s=<].*}
27 name.prepend 'jest ' if name.start_with?('--')32 name.prepend 'jest ' if name.start_with?('--')
28 name.prepend 'Config: ' if slug == 'configuration'33 name.prepend 'Config: ' if slug == 'configuration'
29 id = node['href'].remove('#')34 id = node['href'].remove('#')
30 [name, id]35
36 entries << [name, id]
31 end37 end
38
39 entries
32 end40 end
33 end41 end
34 end42 end
lib/docs/scrapers/jest.rb+4−4
@@ -1,11 +1,11 @@
1module Docs1module Docs
2 class Jest < UrlScraper2 class Jest < UrlScraper
3 self.type = 'simple'3 self.type = 'simple'
4 self.release = '24.8.0'4 self.release = '24.9'
5 self.base_url = 'https://jestjs.io/docs/en/'5 self.base_url = 'https://jestjs.io/docs/en/'
6 self.root_path = 'getting-started'6 self.root_path = 'getting-started'
7 self.links = {7 self.links = {
8 home: 'https://facebook.github.io/jest/',8 home: 'https://jestjs.io/',
9 code: 'https://github.com/facebook/jest'9 code: 'https://github.com/facebook/jest'
10 }10 }
11 11
@@ -14,8 +14,8 @@ module Docs · 2 unmodified lines
14 options[:container] = '.docMainWrapper'14 options[:container] = '.docMainWrapper'
15 15
16 options[:attribution] = <<-HTML16 options[:attribution] = <<-HTML
17 &copy; 2014&ndash;present Facebook Inc.<br>17 &copy; 2019 Facebook, Inc. and its affiliates.<br>
18 Licensed under the BSD License.18 Licensed under the MIT License.
19 HTML19 HTML
20 20
21 def get_latest_version(opts)21 def get_latest_version(opts)