1
0
Эх сурвалжийг харах

Update and improve Rails documentation (4.2.1)

Thibaut 10 жил өмнө
parent
commit
4da29f8158

+ 1 - 1
assets/javascripts/templates/pages/about_tmpl.coffee

@@ -302,7 +302,7 @@ credits = [
     'https://www.ruby-lang.org/en/about/license.txt'
   ], [
     'Ruby on Rails',
-    '2004-2014 David Heinemeier Hansson<br>Rails, Ruby on Rails, and the Rails logo are trademarks of David Heinemeier Hansson.',
+    '2004-2015 David Heinemeier Hansson<br>Rails, Ruby on Rails, and the Rails logo are trademarks of David Heinemeier Hansson.',
     'MIT',
     'https://raw.github.com/rails/rails/master/activerecord/MIT-LICENSE'
   ], [

+ 3 - 1
lib/docs/filters/rdoc/entries.rb

@@ -25,6 +25,8 @@ module Docs
         at_css('> .description p') || css('.documentation-section').any? { |node| node.content.present? }
       end
 
+      IGNORE_METHODS = %w(version gem_version)
+
       def additional_entries
         return [] if root_page?
         require 'cgi'
@@ -36,7 +38,7 @@ module Docs
           name.gsub! '-', '%'
           name = CGI.unescape(name)
 
-          unless name.start_with? '_'
+          unless name.start_with?('_') || IGNORE_METHODS.include?(name)
             name.prepend self.name + (node['id'] =~ /\A\w+-c-/ ? '::' : '#')
             entries << [name, node['id']] unless entries.any? { |entry| entry[0] == name }
           end

+ 10 - 21
lib/docs/scrapers/rdoc/rails.rb

@@ -1,27 +1,13 @@
 module Docs
   class Rails < Rdoc
-    # Generated with:
-    # find \
-    #   actionmailer \
-    #   actionpack \
-    #   actionview \
-    #   activemodel \
-    #   activejob \
-    #   activerecord \
-    #   activesupport \
-    #   railties \
-    #   -name '*.rb' \
-    #   -not -name 'version.rb' \
-    #   -not -wholename '*generators/*' \
-    #   -not -wholename '*test/*' \
-    #   -not -wholename '*examples/*' \
-    # | xargs \
-    #   rdoc --format=darkfish --no-line-numbers --op=rdoc --visibility=public
-
     self.name = 'Ruby on Rails'
     self.slug = 'rails'
-    self.version = '4.2.0'
+    self.version = '4.2.1'
     self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Rails'
+    self.links = {
+      home: 'http://rubyonrails.org/',
+      code: 'https://github.com/rails/rails'
+    }
 
     html_filters.replace 'rdoc/entries', 'rails/entries'
 
@@ -66,10 +52,13 @@ module Docs
       /\AActionView\/Resolver/,
       /\AActiveSupport\/Multibyte\/Unicode\//,
       /\AActiveSupport\/XML/i,
-      /\ASourceAnnotationExtractor/]
+      /\ASourceAnnotationExtractor/,
+      /\AI18n\/Railtie/,
+      /\ARails\/AppBuilder/,
+      /\ARails\/PluginBuilder/]
 
     options[:attribution] = <<-HTML
-      &copy; 2004&ndash;2014 David Heinemeier Hansson<br>
+      &copy; 2004&ndash;2015 David Heinemeier Hansson<br>
       Licensed under the MIT License.
     HTML
   end