1
0

rails.rb 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. module Docs
  2. class Rails < Rdoc
  3. # Instructions:
  4. # 1. Download a release at https://github.com/rails/rails/releases
  5. # 2. Open "railties/lib/rails/api/task.rb" and comment out any code related to sdoc ("configure_sdoc")
  6. # 3. Run "bundle install --without db && bundle exec rake rdoc" (in the Rails directory)
  7. # 4. Run "cd guides && bundle exec rake guides:generate:html"
  8. # 5. Copy the "guides/output" directory to "html/guides"
  9. # 6. Copy the "html" directory to "docs/rails~[version]"
  10. include FixInternalUrlsBehavior
  11. self.name = 'Ruby on Rails'
  12. self.slug = 'rails'
  13. self.initial_paths = %w(guides/index.html)
  14. self.links = {
  15. home: 'http://rubyonrails.org/',
  16. code: 'https://github.com/rails/rails'
  17. }
  18. html_filters.replace 'rdoc/entries', 'rails/entries'
  19. html_filters.push 'rails/clean_html_guides'
  20. options[:skip_rdoc_filters?] = ->(filter) { filter.slug.start_with?('guides/') }
  21. options[:root_title] = 'Ruby on Rails'
  22. options[:skip] += %w(
  23. guides/credits.html
  24. guides/ruby_on_rails_guides_guidelines.html
  25. guides/contributing_to_ruby_on_rails.html
  26. guides/development_dependencies_install.html
  27. guides/api_documentation_guidelines.html
  28. ActionController/Instrumentation.html
  29. ActionController/Rendering.html
  30. ActionDispatch/DebugExceptions.html
  31. ActionDispatch/Journey/Parser.html
  32. ActionDispatch/Reloader.html
  33. ActionDispatch/Routing/HtmlTableFormatter.html
  34. ActionDispatch/ShowExceptions.html
  35. ActionView/FixtureResolver.html
  36. ActionView/LogSubscriber.html
  37. ActionView/TestCase/Behavior/RenderedViewsCollection.html
  38. ActiveRecord/Tasks/DatabaseTasks.html
  39. ActiveSupport/Dependencies/WatchStack.html
  40. ActiveSupport/Notifications/Fanout.html)
  41. # False positives found by docs:generate
  42. options[:skip].concat %w(
  43. ActionDispatch/www.example.com
  44. ActionDispatch/Http/www.rubyonrails.org
  45. ActionDispatch/Http/www.rubyonrails.co.uk
  46. 'TZ'
  47. active_record_migrations.html
  48. association_basics.html)
  49. options[:skip_patterns] += [
  50. /release_notes/,
  51. /\AActionController\/Testing/,
  52. /\AActionView\/LookupContext/,
  53. /\AActionView\/Resolver/,
  54. /\AActiveSupport\/Multibyte\/Unicode\//,
  55. /\AActiveSupport\/XML/i,
  56. /\ASourceAnnotationExtractor/,
  57. /\AI18n\/Railtie/,
  58. /\AMinitest/,
  59. /\ARails\/API/,
  60. /\ARails\/AppBuilder/,
  61. /\ARails\/PluginBuilder/,
  62. /\ARails\/Generators\/Testing/]
  63. options[:attribution] = ->(filter) do
  64. if filter.slug.start_with?('guides')
  65. <<-HTML
  66. &copy; 2004&ndash;2019 David Heinemeier Hansson<br>
  67. Licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
  68. HTML
  69. else
  70. <<-HTML
  71. &copy; 2004&ndash;2019 David Heinemeier Hansson<br>
  72. Licensed under the MIT License.
  73. HTML
  74. end
  75. end
  76. version '6.0' do
  77. self.release = '6.0.0'
  78. end
  79. version '5.2' do
  80. self.release = '5.2.2'
  81. end
  82. version '5.1' do
  83. self.release = '5.1.6'
  84. end
  85. version '5.0' do
  86. self.release = '5.0.7'
  87. end
  88. version '4.2' do
  89. self.release = '4.2.11'
  90. end
  91. version '4.1' do
  92. self.release = '4.1.16'
  93. end
  94. def get_latest_version(opts)
  95. get_latest_github_release('rails', 'rails', opts)
  96. end
  97. end
  98. end