sequelize.rb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. module Docs
  2. class Sequelize < UrlScraper
  3. include MultipleBaseUrls
  4. self.name = 'Sequelize'
  5. self.slug = 'sequelize'
  6. self.type = 'simple'
  7. self.links = {
  8. home: 'https://sequelize.org/',
  9. code: 'https://github.com/sequelize/sequelize'
  10. }
  11. # List of content filters (to be applied sequentially)
  12. html_filters.push 'sequelize/entries', 'sequelize/clean_html'
  13. # Skip the source files, the license page and the "Who's using Sequelize" page
  14. options[:skip_patterns] = [/\.js\.html/, /manual\/legal\.html/, /manual\/whos-using\.html/]
  15. # License information that appears appears at the bottom of the entry page
  16. options[:attribution] = <<-HTML
  17. Copyright &copy; 2014&ndash;present Sequelize contributors<br>
  18. Licensed under the MIT License.
  19. HTML
  20. def initial_urls
  21. [
  22. "https://sequelize.org/docs/v6/",
  23. "https://sequelize.org/api/v6/identifiers.html",
  24. ]
  25. end
  26. version '6' do
  27. self.release = '6.23.2'
  28. self.base_url = "https://sequelize.org/docs/v6/"
  29. self.base_urls = [
  30. "https://sequelize.org/docs/v6/",
  31. "https://sequelize.org/api/v6/",
  32. ]
  33. end
  34. version '5' do
  35. self.release = '5.22.0'
  36. self.base_url = "https://sequelize.org/v#{version}/"
  37. end
  38. version '4' do
  39. self.release = '4.44.4'
  40. self.base_url = "https://sequelize.org/v#{version}/"
  41. end
  42. # Method to fetch the most recent version of the project
  43. def get_latest_version(opts)
  44. get_npm_version('sequelize', opts)
  45. end
  46. end
  47. end