mirror of https://github.com/freeCodeCamp/devdocs
parent
07d8d1ac0f
commit
dc0e174253
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 28 KiB |
@ -0,0 +1,73 @@
|
||||
module Docs
|
||||
class Rails
|
||||
class EntriesFilter < Docs::Rdoc::EntriesFilter
|
||||
TYPE_BY_NAME_MATCHES = {
|
||||
/Assertions|::Test|Fixture/ => 'Testing',
|
||||
/\AActiveRecord.+Assoc/ => 'ActiveRecord/Associations',
|
||||
/\AActiveRecord.+Attribute/ => 'ActiveRecord/Attributes',
|
||||
/\AActiveRecord.+(Migration|Schema|Adapters::Table)/ => 'ActiveRecord/Migrations',
|
||||
/\AActiveSupport.+(Subscriber|Notifications)/ => 'ActiveSupport/Instrumentation',
|
||||
/\A(False|Nil|True)Class/ => 'Boolean' }
|
||||
|
||||
TYPE_BY_NAME_STARTS_WITH = {
|
||||
'ActionDispatch::Integration' => 'Testing',
|
||||
'ActionDispatch::Routing' => 'ActionDispatch/Routing',
|
||||
'ActionView::Helpers' => 'ActionView/Helpers',
|
||||
'ActiveModel::Errors' => 'ActiveModel/Validation',
|
||||
'ActiveModel::Valid' => 'ActiveModel/Validation',
|
||||
'ActiveRecord::Batches' => 'ActiveModel/Query',
|
||||
'ActiveRecord::Calculations' => 'ActiveModel/Query',
|
||||
'ActiveRecord::Connection' => 'ActiveModel/Connection',
|
||||
'ActiveRecord::FinderMethods' => 'ActiveModel/Query',
|
||||
'ActiveRecord::Query' => 'ActiveModel/Query',
|
||||
'ActiveRecord::Relation' => 'ActiveModel/Relation',
|
||||
'ActiveRecord::Result' => 'ActiveModel/Connection',
|
||||
'ActiveRecord::Scoping' => 'ActiveModel/Query',
|
||||
'ActiveRecord::SpawnMethods' => 'ActiveModel/Query',
|
||||
'ActiveSupport::Cach' => 'ActiveSupport/Caching',
|
||||
'ActiveSupport::Hash' => 'ActiveSupport/Hash',
|
||||
'ActiveSupport::Inflector' => 'ActiveSupport/Inflector',
|
||||
'ActiveSupport::Ordered' => 'ActiveSupport/Hash',
|
||||
'ActiveSupport::Time' => 'ActiveSupport/TimeZones',
|
||||
'Rails::Application' => 'Rails/Application',
|
||||
'Rails::Engine' => 'Rails/Engine',
|
||||
'Rails::Railtie' => 'Rails/Railtie' }
|
||||
|
||||
def get_name
|
||||
name = super
|
||||
name.sub! 'HashWithIndifferentAccess::HashWithIndifferentAccess', 'HashWithIndifferentAccess'
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
parent = at_css('.meta-parent').try(:content).to_s
|
||||
|
||||
if [name, parent].any? { |str| str.end_with?('Error') || str.end_with?('Exception') }
|
||||
return 'Errors'
|
||||
end
|
||||
|
||||
TYPE_BY_NAME_MATCHES.each_pair do |key, value|
|
||||
return value if name =~ key
|
||||
end
|
||||
|
||||
TYPE_BY_NAME_STARTS_WITH.each_pair do |key, value|
|
||||
return value if name.start_with?(key)
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
def include_default_entry?
|
||||
super && !skip?
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
skip? ? [] : super
|
||||
end
|
||||
|
||||
def skip?
|
||||
@skip ||= !css('p').any? { |node| node.content.present? }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,96 @@
|
||||
module Docs
|
||||
class Rails < Rdoc
|
||||
# Generated with:
|
||||
# find \
|
||||
# actionmailer \
|
||||
# actionpack \
|
||||
# activemodel \
|
||||
# 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.0.1'
|
||||
self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Rails'
|
||||
|
||||
html_filters.replace 'rdoc/entries', 'rails/entries'
|
||||
|
||||
options[:root_title] = 'Ruby on Rails'
|
||||
|
||||
options[:skip] += %w(
|
||||
AbstractController/Callbacks.html
|
||||
AbstractController/UrlFor.html
|
||||
ActionController.html
|
||||
ActionController/Instrumentation.html
|
||||
ActionController/ModelNaming.html
|
||||
ActionController/Rendering.html
|
||||
ActionController/Rescue.html
|
||||
ActionController/UrlFor.html
|
||||
ActionDispatch/DebugExceptions.htnl
|
||||
ActionDispatch/Http/FilterParameters.html
|
||||
ActionDispatch/Http/URL.html
|
||||
ActionDispatch/Integration/Runner.html
|
||||
ActionDispatch/Integration/Session.html
|
||||
ActionDispatch/Reloader.html
|
||||
ActionDispatch/RequestId.html
|
||||
ActionDispatch/Routing/HtmlTableFormatter.html
|
||||
ActionDispatch/Routing/Mapper.html
|
||||
ActionDispatch/ShowExceptions.html
|
||||
ActionView.html
|
||||
ActionView/Context.html
|
||||
ActionView/DependencyTracker/ERBTracker.html
|
||||
ActionView/FileSystemResolver.html
|
||||
ActionView/FixtureResolver.html
|
||||
ActionView/LogSubscriber.html
|
||||
ActionView/ModelNaming.html
|
||||
ActionView/Template/Handlers/Erubis.html
|
||||
ActiveModel.html
|
||||
ActiveModel/Lint/Tests.html
|
||||
ActiveRecord.html
|
||||
ActiveRecord/DynamicMatchers/Finder.html
|
||||
ActiveRecord/Sanitization.html
|
||||
ActiveRecord/Tasks/DatabaseTasks.html
|
||||
ActiveSupport.html
|
||||
ActiveSupport/Configurable/Configuration.html
|
||||
ActiveSupport/Dependencies/WatchStack.html
|
||||
ActiveSupport/DescendantsTracker.html
|
||||
ActiveSupport/FileUpdateChecker.html
|
||||
ActiveSupport/Notifications/Fanout.html
|
||||
ActiveSupport/Testing/ConstantLookup.html
|
||||
ActiveSupport/Testing/Declarative.html
|
||||
ActiveSupport/Testing/Isolation/Subprocess.html
|
||||
Rails/API/Task.html
|
||||
Rails/ConsoleMethods.html)
|
||||
|
||||
options[:skip_patterns] = [
|
||||
/\AAbstractController\/ViewPaths/,
|
||||
/\AActionController\/Caching(?!\/Fragments|\.)/,
|
||||
/\AActionController\/HideActions/,
|
||||
/\AActionController\/RequestForgeryProtection\/ProtectionMethods/,
|
||||
/\AActionController\/Test/,
|
||||
/\AActionDispatch\/RemoteIp/,
|
||||
/\AActionDispatch\/Test/,
|
||||
/\AActionMailer\/DeliveryMethods/,
|
||||
/\AActionView\/LookupContext/,
|
||||
/\AActionView\/Resolver/,
|
||||
/\AActiveRecord\/ConnectionAdapters\/(?!DatabaseStatements|SchemaStatements|Table)/,
|
||||
/\AActiveSupport\/JSON\//,
|
||||
/\AActiveSupport\/Multibyte\/Unicode\//,
|
||||
/\AActiveSupport\/XML/i,
|
||||
/\ALogger/,
|
||||
/\ASourceAnnotationExtractor/]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2004–2013 David Heinemeier Hansson<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 802 B |
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1 @@
|
||||
http://commons.wikimedia.org/wiki/File:Ruby_logo.svg
|
Loading…
Reference in new issue