Update and improve Ruby documentation (2.2.0)

pull/165/head
Thibaut 10 years ago
parent b58bc8bc58
commit 38b16ed87a

@ -17,6 +17,8 @@ module Docs
'Profiler__' => 'Profiler', 'Profiler__' => 'Profiler',
'Psych' => 'YAML', 'Psych' => 'YAML',
'Rinda' => 'DRb', 'Rinda' => 'DRb',
'SimpleDelegator' => 'Delegator',
'SingleForwardable' => 'Forwardable',
'SortedSet' => 'Set', 'SortedSet' => 'Set',
'TCPServer' => 'Socket', 'TCPServer' => 'Socket',
'TempIO' => 'Tempfile', 'TempIO' => 'Tempfile',
@ -35,6 +37,9 @@ module Docs
'Socket' => 'Socket' } 'Socket' => 'Socket' }
def get_type def get_type
return 'Language' if guide?
return $1 if name =~ /\A(Net\:\:(?:FTP|HTTP|IMAP|SMTP))/
type = super type = super
REPLACE_TYPE_STARTS_WITH.each_pair do |key, value| REPLACE_TYPE_STARTS_WITH.each_pair do |key, value|
@ -47,6 +52,32 @@ module Docs
REPLACE_TYPE[type] || type REPLACE_TYPE[type] || type
end end
def additional_entries
return super unless guide?
if slug == 'syntax/control_expressions_rdoc' || slug == 'syntax/miscellaneous_rdoc'
css('h2 > code').each_with_object([]) do |node, entries|
name = node.content.strip
entries << [name, node.parent['id'], 'Syntax'] unless entries.any? { |e| e[0] == name }
end
elsif slug == 'globals_rdoc'
css('dt').map do |node|
name = node['id'] = node.content.strip
[name, name, 'Globals']
end
else
[]
end
end
def include_default_entry?
guide? || super
end
def guide?
slug =~ /[^\/]+_rdoc/
end
end end
end end
end end

@ -1,59 +1,56 @@
module Docs module Docs
class Ruby < Rdoc class Ruby < Rdoc
# Generated with: # Generated with:
# find \ # rdoc \
# *.c \ # --root . \
# lib \ # --page-dir doc \
# ext/bigdecimal \ # --encoding=UTF-8 \
# ext/date \ # --visibility=public \
# ext/digest \ # --format=darkfish \
# ext/json \ # --no-line-numbers \
# ext/pathname \ # --op html .
# ext/psych \
# ext/readline \
# ext/ripper \
# ext/socket \
# ext/stringio \
# ext/zlib \
# \( -name '*.c' -or -name '*.rb' \) \
# -not -wholename '*sample/*' \
# | xargs \
# rdoc --format=darkfish --no-line-numbers --op=rdoc --visibility=public
self.version = '2.1.3' self.version = '2.2.0'
self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby' self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby'
html_filters.replace 'rdoc/entries', 'ruby/entries' html_filters.replace 'rdoc/entries', 'ruby/entries'
options[:root_title] = 'Ruby Programming Language' options[:root_title] = 'Ruby Programming Language'
options[:title] = ->(filter) { filter.slug == 'globals_rdoc' ? 'Globals' : false }
options[:skip] += %w( options[:skip] += %w(
fatal.html contributing_rdoc.html
CompositePublisher.html contributors_rdoc.html
dtrace_probes_rdoc.html
maintainers_rdoc.html
regexp_rdoc.html
standard_library_rdoc.html
syntax_rdoc.html
Data.html Data.html
E2MM.html
English.html English.html
GServer.html Fcntl.html
MakeMakefile.html Kconv.html
ParallelEach.html NKF.html
SshDirPublisher.html OLEProperty.html
SshFilePublisher.html OptParse.html
SshFreshDirPublisher.html UnicodeNormalize.html)
YAML/DBM.html)
options[:skip_patterns] = [ options[:skip_patterns] += [
/\AComplex/, /\Alib\//,
/\ADEBUGGER__/,
/\AException2MessageMapper/, /\AException2MessageMapper/,
/\AJSON\/Ext/, /\AJSON\/Ext/,
/\AGem/, /\AGem/,
/\AHTTP/i, /\AHTTP/i,
/\AIRB/, /\AIRB/,
/\AMakeMakefile/i,
/\AMiniTest/i, /\AMiniTest/i,
/\ANet\/(?!HTTP)/,
/\ANQXML/, /\ANQXML/,
/\AOpenSSL/, /\AOpenSSL/,
/\AOptionParser\//, /\AOptionParser\//,
/\APrettyPrint/,
/\APride/, /\APride/,
/\AProfiler__/,
/\APsych\//, /\APsych\//,
/\ARacc/, /\ARacc/,
/\ARake/, /\ARake/,
@ -65,6 +62,7 @@ module Docs
/\ASocket\//, /\ASocket\//,
/\ATest/, /\ATest/,
/\AWEBrick/, /\AWEBrick/,
/win32/i,
/\AXML/, /\AXML/,
/\AXMP/] /\AXMP/]

Loading…
Cancel
Save