ruby-changes:36651
From: drbrain <ko1@a...>
Date: Sun, 7 Dec 2014 10:22:56 +0900 (JST)
Subject: [ruby-changes:36651] drbrain:r48732 (trunk): * lib/rdoc: Update to RDoc 4.2.0.
drbrain 2014-12-07 10:22:37 +0900 (Sun, 07 Dec 2014) New Revision: 48732 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48732 Log: * lib/rdoc: Update to RDoc 4.2.0. * test/rdoc: ditto. Added directories: trunk/lib/rdoc/generator/template/darkfish/css/ Added files: trunk/lib/rdoc/generator/template/darkfish/css/fonts.css trunk/lib/rdoc/generator/template/darkfish/css/rdoc.css trunk/lib/rdoc/ri/task.rb Removed files: trunk/lib/rdoc/generator/template/darkfish/fonts.css trunk/lib/rdoc/generator/template/darkfish/rdoc.css Modified files: trunk/ChangeLog trunk/lib/rdoc/generator/darkfish.rb trunk/lib/rdoc/generator/json_index.rb trunk/lib/rdoc/generator/template/darkfish/_head.rhtml trunk/lib/rdoc/known_classes.rb trunk/lib/rdoc/markdown.rb trunk/lib/rdoc/markup/to_html.rb trunk/lib/rdoc/markup/to_label.rb trunk/lib/rdoc/parser/c.rb trunk/lib/rdoc/rd/block_parser.rb trunk/lib/rdoc/rd/inline_parser.rb trunk/lib/rdoc/single_class.rb trunk/lib/rdoc/stats.rb trunk/lib/rdoc/test_case.rb trunk/lib/rdoc.rb trunk/test/rdoc/test_rdoc_generator_darkfish.rb trunk/test/rdoc/test_rdoc_generator_json_index.rb trunk/test/rdoc/test_rdoc_generator_markup.rb trunk/test/rdoc/test_rdoc_markup_attribute_manager.rb trunk/test/rdoc/test_rdoc_markup_heading.rb trunk/test/rdoc/test_rdoc_markup_to_html.rb trunk/test/rdoc/test_rdoc_markup_to_html_snippet.rb trunk/test/rdoc/test_rdoc_markup_to_label.rb trunk/test/rdoc/test_rdoc_single_class.rb trunk/test/rdoc/test_rdoc_stats.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 48731) +++ ChangeLog (revision 48732) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Dec 7 10:20:55 2014 Eric Hodel <drbrain@s...> + + * lib/rdoc: Update to RDoc 4.2.0. + * test/rdoc: ditto. + Sun Dec 7 09:52:30 2014 Eric Hodel <drbrain@s...> * lib/rubygems: Update to RubyGems 2.4.5. Index: lib/rdoc.rb =================================================================== --- lib/rdoc.rb (revision 48731) +++ lib/rdoc.rb (revision 48732) @@ -64,7 +64,7 @@ module RDoc https://github.com/ruby/ruby/blob/trunk/lib/rdoc.rb#L64 ## # RDoc version you are using - VERSION = '4.2.0.alpha' + VERSION = '4.2.0' ## # Method visibilities Index: lib/rdoc/markdown.rb =================================================================== --- lib/rdoc/markdown.rb (revision 48731) +++ lib/rdoc/markdown.rb (revision 48732) @@ -2822,6 +2822,172 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L2822 return _tmp end + # HtmlOpenAnchor = "<" Spnl ("a" | "A") Spnl HtmlAttribute* ">" + def _HtmlOpenAnchor + + _save = self.pos + while true # sequence + _tmp = match_string("<") + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + + _save1 = self.pos + while true # choice + _tmp = match_string("a") + break if _tmp + self.pos = _save1 + _tmp = match_string("A") + break if _tmp + self.pos = _save1 + break + end # end choice + + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + while true + _tmp = apply(:_HtmlAttribute) + break unless _tmp + end + _tmp = true + unless _tmp + self.pos = _save + break + end + _tmp = match_string(">") + unless _tmp + self.pos = _save + end + break + end # end sequence + + set_failed_rule :_HtmlOpenAnchor unless _tmp + return _tmp + end + + # HtmlCloseAnchor = "<" Spnl "/" ("a" | "A") Spnl ">" + def _HtmlCloseAnchor + + _save = self.pos + while true # sequence + _tmp = match_string("<") + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + _tmp = match_string("/") + unless _tmp + self.pos = _save + break + end + + _save1 = self.pos + while true # choice + _tmp = match_string("a") + break if _tmp + self.pos = _save1 + _tmp = match_string("A") + break if _tmp + self.pos = _save1 + break + end # end choice + + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + _tmp = match_string(">") + unless _tmp + self.pos = _save + end + break + end # end sequence + + set_failed_rule :_HtmlCloseAnchor unless _tmp + return _tmp + end + + # HtmlAnchor = HtmlOpenAnchor (HtmlAnchor | !HtmlCloseAnchor .)* HtmlCloseAnchor + def _HtmlAnchor + + _save = self.pos + while true # sequence + _tmp = apply(:_HtmlOpenAnchor) + unless _tmp + self.pos = _save + break + end + while true + + _save2 = self.pos + while true # choice + _tmp = apply(:_HtmlAnchor) + break if _tmp + self.pos = _save2 + + _save3 = self.pos + while true # sequence + _save4 = self.pos + _tmp = apply(:_HtmlCloseAnchor) + _tmp = _tmp ? nil : true + self.pos = _save4 + unless _tmp + self.pos = _save3 + break + end + _tmp = get_byte + unless _tmp + self.pos = _save3 + end + break + end # end sequence + + break if _tmp + self.pos = _save2 + break + end # end choice + + break unless _tmp + end + _tmp = true + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_HtmlCloseAnchor) + unless _tmp + self.pos = _save + end + break + end # end sequence + + set_failed_rule :_HtmlAnchor unless _tmp + return _tmp + end + # HtmlBlockOpenAddress = "<" Spnl ("address" | "ADDRESS") Spnl HtmlAttribute* ">" def _HtmlBlockOpenAddress @@ -8289,11 +8455,14 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L8455 return _tmp end - # HtmlBlockInTags = (HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript) + # HtmlBlockInTags = (HtmlAnchor | HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript) def _HtmlBlockInTags _save = self.pos while true # choice + _tmp = apply(:_HtmlAnchor) + break if _tmp + self.pos = _save _tmp = apply(:_HtmlBlockAddress) break if _tmp self.pos = _save @@ -15120,7 +15289,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L15289 self.pos = _save break end - @result = begin; + @result = begin; ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a @@ -15748,6 +15917,9 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L15917 Rules[:_Enumerator] = rule_info("Enumerator", "@NonindentSpace [0-9]+ \".\" @Spacechar+") Rules[:_OrderedList] = rule_info("OrderedList", "&Enumerator (ListTight | ListLoose):a { RDoc::Markup::List.new(:NUMBER, *a) }") Rules[:_ListBlockLine] = rule_info("ListBlockLine", "!@BlankLine !(Indent? (Bullet | Enumerator)) !HorizontalRule OptionallyIndentedLine") + Rules[:_HtmlOpenAnchor] = rule_info("HtmlOpenAnchor", "\"<\" Spnl (\"a\" | \"A\") Spnl HtmlAttribute* \">\"") + Rules[:_HtmlCloseAnchor] = rule_info("HtmlCloseAnchor", "\"<\" Spnl \"/\" (\"a\" | \"A\") Spnl \">\"") + Rules[:_HtmlAnchor] = rule_info("HtmlAnchor", "HtmlOpenAnchor (HtmlAnchor | !HtmlCloseAnchor .)* HtmlCloseAnchor") Rules[:_HtmlBlockOpenAddress] = rule_info("HtmlBlockOpenAddress", "\"<\" Spnl (\"address\" | \"ADDRESS\") Spnl HtmlAttribute* \">\"") Rules[:_HtmlBlockCloseAddress] = rule_info("HtmlBlockCloseAddress", "\"<\" Spnl \"/\" (\"address\" | \"ADDRESS\") Spnl \">\"") Rules[:_HtmlBlockAddress] = rule_info("HtmlBlockAddress", "HtmlBlockOpenAddress (HtmlBlockAddress | !HtmlBlockCloseAddress .)* HtmlBlockCloseAddress") @@ -15847,7 +16019,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L16019 Rules[:_HtmlBlockOpenScript] = rule_info("HtmlBlockOpenScript", "\"<\" Spnl (\"script\" | \"SCRIPT\") Spnl HtmlAttribute* \">\"") Rules[:_HtmlBlockCloseScript] = rule_info("HtmlBlockCloseScript", "\"<\" Spnl \"/\" (\"script\" | \"SCRIPT\") Spnl \">\"") Rules[:_HtmlBlockScript] = rule_info("HtmlBlockScript", "HtmlBlockOpenScript (!HtmlBlockCloseScript .)* HtmlBlockCloseScript") - Rules[:_HtmlBlockInTags] = rule_info("HtmlBlockInTags", "(HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript)") + Rules[:_HtmlBlockInTags] = rule_info("HtmlBlockInTags", "(HtmlAnchor | HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript)") Rules[:_HtmlBlock] = rule_info("HtmlBlock", "< (HtmlBlockInTags | HtmlComment | HtmlBlockSelfClosing | HtmlUnclosed) > @BlankLine+ { if html? then RDoc::Markup::Raw.new text end }") Rules[:_HtmlUnclosed] = rule_info("HtmlUnclosed", "\"<\" Spnl HtmlUnclosedType Spnl HtmlAttribute* Spnl \">\"") Rules[:_HtmlUnclosedType] = rule_info("HtmlUnclosedType", "(\"HR\" | \"hr\")") Index: lib/rdoc/generator/json_index.rb =================================================================== --- lib/rdoc/generator/json_index.rb (revision 48731) +++ lib/rdoc/generator/json_index.rb (revision 48732) @@ -1,4 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/json_index.rb#L1 require 'json' +require 'zlib' ## # The JsonIndex generator is designed to complement an HTML generator and @@ -151,6 +152,49 @@ class RDoc::Generator::JsonIndex https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/json_index.rb#L152 end end end + + ## + # Compress the search_index.js file using gzip + + def generate_gzipped + debug_msg "Compressing generated JSON index" + out_dir = @base_dir + @options.op_dir + + search_index_file = out_dir + SEARCH_INDEX_FILE + outfile = out_dir + "#{search_index_file}.gz" + + debug_msg "Reading the JSON index file from %s" % search_index_file + search_index = search_index_file.read + + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| + gz.mtime = File.mtime(search_index_file) + gz.orig_name = search_index_file.to_s + gz.write search_index + gz.close + end + + # GZip the rest of the js files + Dir.chdir @template_dir do + Dir['**/*.js'].each do |source| + dest = out_dir + source + outfile = out_dir + "#{dest}.gz" + + debug_msg "Reading the original js file from %s" % dest + data = dest.read + + debug_msg "Writing gzipped file to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| + gz.mtime = File.mtime(dest) + gz.orig_name = dest.to_s + gz.write data + gz.close + end + end + end + end ## # Adds classes and modules to the index Index: lib/rdoc/generator/template/darkfish/fonts.css =================================================================== --- lib/rdoc/generator/template/darkfish/fonts.css (revision 48731) +++ lib/rdoc/generator/template/darkfish/fonts.css (revision 48732) @@ -1,167 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/fonts.css#L0 -/* - * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), - * with Reserved Font Name "Source". All Rights Reserved. Source is a - * trademark of Adobe Systems Incorporated in the United States and/or other - * countries. - * - * This Font Software is licensed under the SIL Open Font License, Version - * 1.1. - * - * This license is copied below, and is also available with a FAQ at: - * http://scripts.sil.org/OFL - */ - -@font-face { - font-family: "Source Code Pro"; - font-style: normal; - font-weight: 400; - src: local("Source Code Pro"), - local("SourceCodePro-Regular"), - url("fonts/SourceCodePro-Regular.ttf") format("truetype"); -} - -@font-face { - font-family: "Source Code Pro"; - font-style: normal; - font-weight: 700; - src: local("Source Code Pro Bold"), - local("SourceCodePro-Bold"), - url("fonts/SourceCodePro-Bold.ttf") format("truetype"); -} - -/* - * Copyright (c) 2010, ukasz Dziedzic (dziedzic@t...), - * with Reserved Font Name Lato. - * - * This Font Software is licensed under the SIL Open Font License, Version - * 1.1. - * - * This license is copied below, and is also available with a FAQ at: - * http://scripts.sil.org/OFL - */ - -@font-face { - font-family: "Lato"; - font-style: normal; - font-weight: 300; - src: local("Lato Light"), - local("Lato-Light"), - url("fonts/Lato-Light.ttf") format("truetype"); -} - -@font-face { - font-family: "Lato"; - font-style: italic; - font-weight: 300; - src: local("Lato Light Italic"), - local("Lato-LightItalic"), - url("fonts/Lato-LightItalic.ttf") format("truetype"); -} - -@font-face { - font-family: "Lato"; - font-style: normal; - font-weight: 700; - src: local("Lato Regular"), - local("Lato-Regular"), - url("fonts/Lato-Regular.ttf") format("truetype"); -} - -@font-face { - font-family: "Lato"; - font-style: italic; - font-weight: 700; - src: local("Lato Italic"), - local("Lato-Italic"), - url("fonts/Lato-RegularItalic.ttf") format("truetype"); -} - -/* - * ----------------------------------------------------------- - * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 - * ----------------------------------------------------------- - * - * PREAMBLE - * The goals of the Open Font License (OFL) are to stimulate worldwide - * development of collaborative font projects, to support the font creation - * efforts of academic and linguistic communities, and to provide a free and - * open framework in which fonts may be shared and improved in partnership - * with others. - * - * The OFL allows the licensed fonts to be used, studied, modified and - * redistributed freely as long as they are not sold by themselves. The - * fonts, including any derivative works, can be bundled, embedded, - * redistributed and/or sold with any software provided that any reserved - * names are not used by derivative works. The fonts and derivatives, - * however, cannot be released under any other type of license. The - * requirement for fonts to remain under this license does not apply - * to any document created using the fonts or their derivatives. - * - * DEFINITIONS - * "Font Software" refers to the set of files released by the Copyright - * Holder(s) under this license and clearly marked as such. This may - * include source files, build scripts and documentation. - * - * "Reserved Font Name" refers to any names specified as such after the - * copyright statement(s). - * - * "Original Version" refers to the collection of Font Software components as - * distributed by the Copyright Holder(s). - * - * "Modified Version" refers to any derivative made by adding to, deleting, - * or substituting -- in part or in whole -- any of the components of the - * Original Version, by changing formats or by porting the Font Software to a - * new environment. - * - * "Author" refers to any designer, engineer, programmer, technical - * writer or other person who contributed to the Font Software. - * - * PERMISSION & CONDITIONS - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of the Font Software, to use, study, copy, merge, embed, modify, - * redistribute, and sell modified and unmodified copies of the Font - * Software, subject to the following conditions: - * - * 1) Neither the Font Software nor any of its individual components, - * in Original or Modified Versions, may be sold by itself. - * - * 2) Original or Modified Versions of the Font Software may be bundled, - * redistributed and/or sold with any software, provided that each copy - * contains the above copyright notice and this license. These can be - * included either as stand-alone text files, human-readable headers or - * in the appropriate machine-readable metadata fields within text or - * binary files as long as those fields can be easily viewed by the user. - * - * 3) No Modified Version of the Font Software may use the Reserved Font - * Name(s) unless explicit written permission is granted by the corresponding - * Copyright Holder. This restriction only applies to the primary font name as - * presented to the users. - * - * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font - * Software shall not be used to promote, endorse or advertise any - * Modified Version, except to acknowledge the contribution(s) of the - * Copyright Holder(s) and the Author(s) or with their explicit written - * permission. - * - * 5) The Font Software, modified or unmodified, in part or in whole, - * must be distributed entirely under this license, and must not be - * distributed under any other license. The requirement for fonts to - * remain under this license does not apply to any document created - * using the Font Software. - * - * TERMINATION - * This license becomes null and void if any of the above conditions are - * not met. - * - * DISCLAIMER - * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT - * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL - * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM - * OTHER DEALINGS IN THE FONT SOFTWARE. - */ - Index: lib/rdoc/generator/template/darkfish/rdoc.css =================================================================== --- lib/rdoc/generator/template/darkfish/rdoc.css (revision 48731) +++ lib/rdoc/generator/template/darkfish/rdoc.css (revision 48732) @@ -1,590 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/rdoc.css#L0 -/* - * "Darkfish" Rdoc CSS - * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $ - * - * Author: Michael Granger <ged@F...> - * - */ - -/* vim: ft=css et sw=2 ts=2 sts=2 */ -/* Base Green is: #6C8C22 */ - -* { padding: 0; margin: 0; } - -body { - background: #fafafa; - font-family: Lato, sans-serif; - font-weight: 300; -} - -h1 span, -h2 span, -h3 span, -h4 span, -h5 span, -h6 span { - position: relative; - - display: none; - padding-left: 1em; - line-height: 0; - vertical-align: baseline; - font-size: 10px; -} - -h1 span { top: -1.3em; } -h2 span { top: -1.2em; } -h3 span { top: -1.0em; } -h4 span { top: -0.8em; } -h5 span { top: -0.5em; } -h6 span { top: -0.5em; } - -h1:hover span, -h2:hover span, -h3:hover span, -h4:hover span, -h5:hover span, -h6:hover span { - display: inline; -} - -:link, -:visited { - color: #6C8C22; - text-decoration: none; -} - -:link:hover, -:visited:hover { - border-bottom: 1px dot (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/