phpunit.rb 873 B

12345678910111213141516171819202122232425262728293031
  1. module Docs
  2. class Phpunit < UrlScraper
  3. self.name = 'PHPUnit'
  4. self.type = 'phpunit'
  5. self.slug = 'phpunit'
  6. self.version = '4.3'
  7. self.base_url = 'https://phpunit.de/manual/4.3/en/'
  8. self.initial_paths = %w(appendixes.assertions.html appendixes.annotations.html)
  9. html_filters.push 'phpunit/entries', 'phpunit/clean_html', 'title'
  10. options[:skip_links] = true
  11. options[:title] = false
  12. options[:root_title] = "#{self.name} #{self.version}"
  13. options[:fix_urls] = ->(url) do
  14. if self.initial_paths.include? url[/\/([A-z.-]+)#/, 1]
  15. url = url[/#(.+)/, 1].downcase
  16. url.gsub! /(\w+\.\w+)\.(\w+)/, '\1#\2'
  17. end
  18. url
  19. end
  20. options[:attribution] = <<-HTML
  21. &copy; 2005&ndash;2014 Sebastian Bergmann<br>
  22. Licensed under the Creative Commons Attribution 3.0 Unported License.
  23. HTML
  24. end
  25. end