pull/205/head
Sarti Hugo 10 years ago
parent b4b26ae936
commit 905c500909

@ -2,8 +2,8 @@ module Docs
class Drupal < UrlScraper class Drupal < UrlScraper
self.name = 'Drupal' self.name = 'Drupal'
self.type = 'drupal' self.type = 'drupal'
self.version = '7.36' self.version = '7.37'
self.base_url = 'https://api.drupal.org/api/drupal' self.base_url = 'https://api.drupal.org/api/drupal/'
self.initial_paths = %w( self.initial_paths = %w(
groups groups
groups?page=1) groups?page=1)
@ -18,8 +18,8 @@ module Docs
options[:root_title] = 'Drupal - Open Source CMS | Drupal.org' options[:root_title] = 'Drupal - Open Source CMS | Drupal.org'
options[:only_patterns] = [ options[:only_patterns] = [
/\/group\/[^\/]+\/7/, /\/group\/[^\/]+/,
/\/function\/[^\/]+\/7/] /\/function\/[^\/]+/]
options[:skip_link] = ->(link) { options[:skip_link] = ->(link) {
begin begin
@ -30,6 +30,26 @@ module Docs
end end
} }
options[:skip] = %w(
'modules-system-system.install/group/updates-7.x-extra/7',
'modules-system-system.install/group/updates-6.x-to-7.x/7')
options[:skip_patterns] = [
/\/group\/updates\-7/,
/\/group\/updates\-6/,
/_update_[0-9]{4}/, # Skip update functions
/\/[4-6](\.[0-9])*$/, # Skip previous versions
/\/[8-9](\.[0-9])*$/, # Skip future versions
/\/function\/calls\//, # Skip function calls listings
/\/function\/implementations\//, # Skip hook implementation listings
/\.test\/function\// # Skip test files
]
options[:fix_urls] = ->(url) do
url.sub! /\/7$/, '' # Remove the version indicator from the current version
url
end
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2000&ndash;2015 by the individual contributors.<br> &copy; 2000&ndash;2015 by the individual contributors.<br>
Licensed under the Creative Commons License, Attribution-ShareAlike2.0.<br> Licensed under the Creative Commons License, Attribution-ShareAlike2.0.<br>
@ -39,8 +59,6 @@ module Docs
# Method used at several places to fix special characters at urls from api.drupal.org # Method used at several places to fix special characters at urls from api.drupal.org
def self.fixUri(path) def self.fixUri(path)
p = path.gsub /%21|!|%2b|%3b|%3a/i, '-' # !+;: p = path.gsub /%21|!|%2b|%3b|%3a/i, '-' # !+;:
p.gsub! /\./, '_' # dots
p.gsub /__/, '..' # revert doble dots to prevent breaking relative urls
end end
end end

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save