ruby-changes:31636
From: drbrain <ko1@a...>
Date: Tue, 19 Nov 2013 09:47:41 +0900 (JST)
Subject: [ruby-changes:31636] drbrain:r43715 (trunk): * lib/rdoc: Update to RDoc master a1195ce. Changes include:
drbrain 2013-11-19 09:47:33 +0900 (Tue, 19 Nov 2013) New Revision: 43715 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43715 Log: * lib/rdoc: Update to RDoc master a1195ce. Changes include: Improved accessibility of the main sidebar navigation. Fixed handling of regexp options in HTML source highlighting. * test/rdoc: ditto. Modified files: trunk/ChangeLog trunk/lib/rdoc/constant.rb trunk/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml trunk/lib/rdoc/generator/template/darkfish/rdoc.css trunk/lib/rdoc/markup/parser.rb trunk/lib/rdoc/ruby_lex.rb trunk/lib/rdoc/store.rb trunk/lib/rdoc.rb trunk/test/rdoc/test_rdoc_generator_darkfish.rb trunk/test/rdoc/test_rdoc_ruby_lex.rb trunk/test/rdoc/test_rdoc_rubygems_hook.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 43714) +++ ChangeLog (revision 43715) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Nov 19 09:47:02 2013 Eric Hodel <drbrain@s...> + + * lib/rdoc: Update to RDoc master a1195ce. Changes include: + + Improved accessibility of the main sidebar navigation. + + Fixed handling of regexp options in HTML source highlighting. + + * test/rdoc: ditto. + Tue Nov 19 09:33:52 2013 Eric Hodel <drbrain@s...> * lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include: Index: lib/rdoc.rb =================================================================== --- lib/rdoc.rb (revision 43714) +++ lib/rdoc.rb (revision 43715) @@ -64,7 +64,7 @@ module RDoc https://github.com/ruby/ruby/blob/trunk/lib/rdoc.rb#L64 ## # RDoc version you are using - VERSION = '4.1.0.preview.1' + VERSION = '4.1.0.preview.2' ## # Method visibilities Index: lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml =================================================================== --- lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml (revision 43714) +++ lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml (revision 43715) @@ -1,11 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml#L1 -<div id="home-section" role="banner" class="nav-section"> +<div id="home-section" role="region" title="Quick navigation" class="nav-section"> <h2> <a href="<%= rel_prefix %>/index.html" rel="home">Home</a> </h2> - <h3> + <div id="table-of-contents-navigation"> <a href="<%= rel_prefix %>/table_of_contents.html#pages">Pages</a> <a href="<%= rel_prefix %>/table_of_contents.html#classes">Classes</a> <a href="<%= rel_prefix %>/table_of_contents.html#methods">Methods</a> - </h3> + </div> </div> Index: lib/rdoc/generator/template/darkfish/rdoc.css =================================================================== --- lib/rdoc/generator/template/darkfish/rdoc.css (revision 43714) +++ lib/rdoc/generator/template/darkfish/rdoc.css (revision 43715) @@ -193,7 +193,8 @@ nav h2 { https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/rdoc.css#L193 text-align: center; } -nav h3 { +nav h3, +#table-of-contents-navigation { margin: 0; padding: 2px 8px 2px 8px; text-align: right; @@ -213,8 +214,13 @@ nav p { https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/rdoc.css#L214 border-top: 0; } -#home-section h2, -#home-section h3 { +#home-section h2 { + text-align: center; +} + +#table-of-contents-navigation { + font-size: 1.2em; + font-weight: bold; text-align: center; } Index: lib/rdoc/constant.rb =================================================================== --- lib/rdoc/constant.rb (revision 43714) +++ lib/rdoc/constant.rb (revision 43715) @@ -63,15 +63,7 @@ class RDoc::Constant < RDoc::CodeObject https://github.com/ruby/ruby/blob/trunk/lib/rdoc/constant.rb#L63 # for a documented class or module. def documented? - return true if super - return false unless @is_alias_for - case @is_alias_for - when String then - found = @store.find_class_or_module @is_alias_for - return false unless found - @is_alias_for = found - end - @is_alias_for.documented? + super or is_alias_for && is_alias_for.documented? end ## Index: lib/rdoc/store.rb =================================================================== --- lib/rdoc/store.rb (revision 43714) +++ lib/rdoc/store.rb (revision 43715) @@ -663,7 +663,7 @@ class RDoc::Store https://github.com/ruby/ruby/blob/trunk/lib/rdoc/store.rb#L663 end ## - # Converts the variable => ClassModule map +variables+ from a C parser into + # Converts the variable => ClassModule map +variables+ from a C parser into # a variable => class name map. def make_variable_map variables Index: lib/rdoc/markup/parser.rb =================================================================== --- lib/rdoc/markup/parser.rb (revision 43714) +++ lib/rdoc/markup/parser.rb (revision 43715) @@ -535,8 +535,8 @@ class RDoc::Markup::Parser https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markup/parser.rb#L535 end ## - # Calculates the column (by character) and line of the current token from - # +scanner+ based on +byte_offset+. + # Calculates the column (by character) and line of the current token based + # on +byte_offset+. def token_pos byte_offset offset = char_pos byte_offset Index: lib/rdoc/ruby_lex.rb =================================================================== --- lib/rdoc/ruby_lex.rb (revision 43714) +++ lib/rdoc/ruby_lex.rb (revision 43715) @@ -1231,8 +1231,8 @@ class RDoc::RubyLex https://github.com/ruby/ruby/blob/trunk/lib/rdoc/ruby_lex.rb#L1231 end if @ltype == "/" - if peek(0) =~ /i|m|x|o|e|s|u|n/ - getc + while peek(0) =~ /i|m|x|o|e|s|u|n/ + str << getc end end Index: test/rdoc/test_rdoc_rubygems_hook.rb =================================================================== --- test/rdoc/test_rdoc_rubygems_hook.rb (revision 43714) +++ test/rdoc/test_rdoc_rubygems_hook.rb (revision 43715) @@ -10,7 +10,7 @@ class TestRDocRubygemsHook < Gem::TestCa https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L10 skip 'requires RubyGems 1.9+' unless Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.9') - @a = util_spec 'a' do |s| + @a = util_spec 'a', 2 do |s| s.rdoc_options = %w[--main MyTitle] s.extra_rdoc_files = %w[README] end Index: test/rdoc/test_rdoc_ruby_lex.rb =================================================================== --- test/rdoc/test_rdoc_ruby_lex.rb (revision 43714) +++ test/rdoc/test_rdoc_ruby_lex.rb (revision 43715) @@ -242,6 +242,26 @@ U https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_ruby_lex.rb#L242 assert_equal expected, tokens end + def test_class_tokenize_regexp_options + tokens = RDoc::RubyLex.tokenize "/hAY/i", nil + + expected = [ + @TK::TkREGEXP.new( 0, 1, 0, "/hAY/i"), + @TK::TkNL .new( 6, 1, 6, "\n"), + ] + + assert_equal expected, tokens + + tokens = RDoc::RubyLex.tokenize "/hAY/ix", nil + + expected = [ + @TK::TkREGEXP.new( 0, 1, 0, "/hAY/ix"), + @TK::TkNL .new( 7, 1, 7, "\n"), + ] + + assert_equal expected, tokens + end + def test_class_tokenize_regexp_backref tokens = RDoc::RubyLex.tokenize "/[csh](..) [csh]\\1 in/", nil Index: test/rdoc/test_rdoc_generator_darkfish.rb =================================================================== --- test/rdoc/test_rdoc_generator_darkfish.rb (revision 43714) +++ test/rdoc/test_rdoc_generator_darkfish.rb (revision 43715) @@ -219,13 +219,8 @@ class TestRDocGeneratorDarkfish < RDoc:: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_generator_darkfish.rb#L219 return end - # This guard is quoted from test/ruby/test_file_exhaustive.rb - unless /emx|mswin|mingw/ =~ RUBY_PLATFORM - # on Windows, nlink is always 1. but this behavior will be changed - # in the future. - assert_operator File.stat(filename).nlink, :>, 1, - "#{filename} is not hard-linked" - end + assert_operator File.stat(filename).nlink, :>, 1, + "#{filename} is not hard-linked" end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/