| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- module Docs
- class Rails < Rdoc
- # Instructions:
- # 1. Download a release at https://github.com/rails/rails/releases
- # 2. Open "railties/lib/rails/api/task.rb" and comment out any code related to sdoc ("configure_sdoc")
- # 3. Run "bundle install --without db && bundle exec rake rdoc" (in the Rails directory)
- # 4. Run "cd guides && bundle exec rake guides:generate:html"
- # 5. Copy the "guides/output" directory to "html/guides"
- # 6. Copy the "html" directory to "docs/rails~[version]"
- include FixInternalUrlsBehavior
- self.name = 'Ruby on Rails'
- self.slug = 'rails'
- self.initial_paths = %w(guides/index.html)
- self.links = {
- home: 'https://rubyonrails.org/',
- code: 'https://github.com/rails/rails'
- }
- html_filters.replace 'rdoc/entries', 'rails/entries'
- html_filters.push 'rails/clean_html_guides'
- options[:skip_rdoc_filters?] = ->(filter) { filter.slug.start_with?('guides/') }
- options[:root_title] = 'Ruby on Rails'
- options[:skip] += %w(
- guides/credits.html
- guides/ruby_on_rails_guides_guidelines.html
- guides/contributing_to_ruby_on_rails.html
- guides/development_dependencies_install.html
- guides/api_documentation_guidelines.html
- ActionController/Instrumentation.html
- ActionController/Rendering.html
- ActionDispatch/DebugExceptions.html
- ActionDispatch/Journey/Parser.html
- ActionDispatch/Reloader.html
- ActionDispatch/Routing/HtmlTableFormatter.html
- ActionDispatch/ShowExceptions.html
- ActionView/FixtureResolver.html
- ActionView/LogSubscriber.html
- ActionView/TestCase/Behavior/RenderedViewsCollection.html
- ActiveRecord/Tasks/DatabaseTasks.html
- ActiveSupport/Dependencies/WatchStack.html
- ActiveSupport/Notifications/Fanout.html)
- # False positives found by docs:generate
- options[:skip].concat %w(
- ActionDispatch/www.example.com
- ActionDispatch/Http/www.rubyonrails.org
- ActionDispatch/Http/www.rubyonrails.co.uk
- 'TZ'
- active_record_migrations.html
- association_basics.html)
- options[:skip_patterns] += [
- /release_notes/,
- /\AActionController\/Testing/,
- /\AActionView\/LookupContext/,
- /\AActionView\/Resolver/,
- /\AActiveSupport\/Multibyte\/Unicode\//,
- /\AActiveSupport\/XML/i,
- /\ASourceAnnotationExtractor/,
- /\AI18n\/Railtie/,
- /\AMinitest/,
- /\ARails\/API/,
- /\ARails\/AppBuilder/,
- /\ARails\/PluginBuilder/,
- /\ARails\/Generators\/Testing/]
- options[:attribution] = ->(filter) do
- if filter.slug.start_with?('guides')
- <<-HTML
- © 2004–2021 David Heinemeier Hansson<br>
- Licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
- HTML
- else
- <<-HTML
- © 2004–2021 David Heinemeier Hansson<br>
- Licensed under the MIT License.
- HTML
- end
- end
- version '7.0' do
- self.release = '7.0.0'
- end
- version '6.1' do
- self.release = '6.1.4'
- end
- version '6.0' do
- self.release = '6.0.4'
- end
- version '5.2' do
- self.release = '5.2.6'
- end
- version '5.1' do
- self.release = '5.1.7'
- end
- version '5.0' do
- self.release = '5.0.7'
- end
- version '4.2' do
- self.release = '4.2.11'
- end
- version '4.1' do
- self.release = '4.1.16'
- end
- def get_latest_version(opts)
- doc = fetch_doc('https://rubyonrails.org/', opts)
- doc
- doc.at_css('.heading__button span').content.scan(/\d\.\d*\.*\d*\.*\d*/)[0]
- end
- end
- end
|