ruby-changes:45630
From: hsbt <ko1@a...>
Date: Fri, 24 Feb 2017 16:39:43 +0900 (JST)
Subject: [ruby-changes:45630] hsbt:r57703 (trunk): Update rdoc-5.1.0
hsbt 2017-02-24 16:39:37 +0900 (Fri, 24 Feb 2017) New Revision: 57703 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57703 Log: Update rdoc-5.1.0 * Details of changes are following url. https://github.com/rdoc/rdoc/blob/master/History.rdoc#510--2017-02-24 Modified files: trunk/lib/rdoc/context.rb trunk/lib/rdoc/generator/json_index.rb trunk/lib/rdoc/i18n/locale.rb trunk/lib/rdoc/parser/ruby.rb trunk/lib/rdoc/parser.rb trunk/lib/rdoc/rd/block_parser.rb trunk/lib/rdoc/rd/inline_parser.rb trunk/lib/rdoc.rb trunk/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text trunk/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text trunk/test/rdoc/test_rdoc_context.rb trunk/test/rdoc/test_rdoc_i18n_text.rb trunk/test/rdoc/test_rdoc_markdown_test.rb trunk/test/rdoc/test_rdoc_ri_driver.rb trunk/test/rdoc/test_rdoc_store.rb trunk/test/rdoc/xref_data.rb trunk/test/rdoc/xref_test_case.rb Index: lib/rdoc.rb =================================================================== --- lib/rdoc.rb (revision 57702) +++ lib/rdoc.rb (revision 57703) @@ -65,7 +65,7 @@ module RDoc https://github.com/ruby/ruby/blob/trunk/lib/rdoc.rb#L65 ## # RDoc version you are using - VERSION = '5.0.0' + VERSION = '5.1.0' ## # Method visibilities Index: lib/rdoc/parser/ruby.rb =================================================================== --- lib/rdoc/parser/ruby.rb (revision 57702) +++ lib/rdoc/parser/ruby.rb (revision 57703) @@ -1666,6 +1666,7 @@ class RDoc::Parser::Ruby < RDoc::Parser https://github.com/ruby/ruby/blob/trunk/lib/rdoc/parser/ruby.rb#L1666 unget_tk tk keep_comment = true + container.current_line_visibility = nil when TkCLASS then parse_class container, single, tk, comment @@ -1888,6 +1889,8 @@ class RDoc::Parser::Ruby < RDoc::Parser https://github.com/ruby/ruby/blob/trunk/lib/rdoc/parser/ruby.rb#L1889 # when TkNL, TkUNLESS_MOD, TkIF_MOD, TkSEMICOLON then container.ongoing_visibility = vis + when TkDEF + container.current_line_visibility = vis else update_visibility container, vis_type, vis, singleton end Index: lib/rdoc/parser.rb =================================================================== --- lib/rdoc/parser.rb (revision 57702) +++ lib/rdoc/parser.rb (revision 57703) @@ -78,7 +78,7 @@ class RDoc::Parser https://github.com/ruby/ruby/blob/trunk/lib/rdoc/parser.rb#L78 return true if s[0, 2] == Marshal.dump('')[0, 2] or s.index("\x00") - mode = "r" + mode = 'r:utf-8' # default source encoding has been chagened to utf-8 s.sub!(/\A#!.*\n/, '') # assume shebang line isn't longer than 1024. encoding = s[/^\s*\#\s*(?:-\*-\s*)?(?:en)?coding:\s*([^\s;]+?)(?:-\*-|[\s;])/, 1] mode = "rb:#{encoding}" if encoding @@ -180,7 +180,9 @@ class RDoc::Parser https://github.com/ruby/ruby/blob/trunk/lib/rdoc/parser.rb#L180 return nil if /coding:/i =~ type type.downcase - rescue ArgumentError # invalid byte sequence, etc. + rescue ArgumentError + rescue Encoding::InvalidByteSequenceError # invalid byte sequence + end ## Index: lib/rdoc/context.rb =================================================================== --- lib/rdoc/context.rb (revision 57702) +++ lib/rdoc/context.rb (revision 57703) @@ -99,6 +99,11 @@ class RDoc::Context < RDoc::CodeObject https://github.com/ruby/ruby/blob/trunk/lib/rdoc/context.rb#L99 attr_accessor :visibility ## + # Current visibility of this line + + attr_writer :current_line_visibility + + ## # Hash of registered methods. Attributes are also registered here, # twice if they are RW. @@ -148,6 +153,7 @@ class RDoc::Context < RDoc::CodeObject https://github.com/ruby/ruby/blob/trunk/lib/rdoc/context.rb#L153 @extends = [] @constants = [] @external_aliases = [] + @current_line_visibility = nil # This Hash maps a method name to a list of unmatched aliases (aliases of # a method not yet encountered). @@ -478,7 +484,11 @@ class RDoc::Context < RDoc::CodeObject https://github.com/ruby/ruby/blob/trunk/lib/rdoc/context.rb#L484 end else @methods_hash[key] = method - method.visibility = @visibility + if @current_line_visibility + method.visibility, @current_line_visibility = @current_line_visibility, nil + else + method.visibility = @visibility + end add_to @method_list, method resolve_aliases method end Index: lib/rdoc/rd/inline_parser.rb =================================================================== --- lib/rdoc/rd/inline_parser.rb (revision 57702) +++ lib/rdoc/rd/inline_parser.rb (revision 57703) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/rd/inline_parser.rb#L1 # # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.4.14 -# from Racc grammer file "". +# from Racc grammar file "". # require 'racc/parser.rb' @@ -704,9 +704,9 @@ Racc_token_to_s_table = [ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/rd/inline_parser.rb#L704 "ref_subst_strings_q", "ref_subst_strings_first", "ref_subst_ele2", - "ref_subst_eles", + "ref_subst_eels", "ref_subst_str_ele_first", - "ref_subst_eles_q", + "ref_subst_eels_q", "ref_subst_ele", "ref_subst_ele_q", "ref_subst_str_ele", Index: lib/rdoc/rd/block_parser.rb =================================================================== --- lib/rdoc/rd/block_parser.rb (revision 57702) +++ lib/rdoc/rd/block_parser.rb (revision 57703) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/rd/block_parser.rb#L1 # # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.4.14 -# from Racc grammer file "". +# from Racc grammar file "". # require 'racc/parser.rb' @@ -253,7 +253,7 @@ def next_token # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/rdoc/rd/block_parser.rb#L253 [:STRINGLINE, line] end else - raise "[BUG] parsing error may occured." + raise "[BUG] parsing error may occurred." end end Index: lib/rdoc/i18n/locale.rb =================================================================== --- lib/rdoc/i18n/locale.rb (revision 57702) +++ lib/rdoc/i18n/locale.rb (revision 57703) @@ -92,7 +92,7 @@ class RDoc::I18n::Locale https://github.com/ruby/ruby/blob/trunk/lib/rdoc/i18n/locale.rb#L92 end ## - # Translates the +message+ into locale. If there is no tranlsation + # Translates the +message+ into locale. If there is no translation # messages for +message+ in locale, +message+ itself is returned. def translate(message) Index: lib/rdoc/generator/json_index.rb =================================================================== --- lib/rdoc/generator/json_index.rb (revision 57702) +++ lib/rdoc/generator/json_index.rb (revision 57703) @@ -170,7 +170,7 @@ class RDoc::Generator::JsonIndex https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/json_index.rb#L170 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 + search_index = search_index_file.read(mode: 'r:utf-8') debug_msg "Writing gzipped search index to %s" % outfile Index: test/rdoc/test_rdoc_store.rb =================================================================== --- test/rdoc/test_rdoc_store.rb (revision 57702) +++ test/rdoc/test_rdoc_store.rb (revision 57703) @@ -162,7 +162,7 @@ class TestRDocStore < XrefTestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_store.rb#L162 def test_all_classes_and_modules expected = %w[ - C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 + C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 C6 Child M1 M1::M2 Parent @@ -213,7 +213,7 @@ class TestRDocStore < XrefTestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_store.rb#L213 def test_classes expected = %w[ - C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 + C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 C6 Child Parent ] Index: test/rdoc/test_rdoc_ri_driver.rb =================================================================== --- test/rdoc/test_rdoc_ri_driver.rb (revision 57702) +++ test/rdoc/test_rdoc_ri_driver.rb (revision 57703) @@ -282,7 +282,7 @@ class TestRDocRIDriver < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_ri_driver.rb#L282 assert_equal expected, out end - def test_add_method_overriden + def test_add_method_overridden util_multi_store out = doc @@ -646,7 +646,7 @@ class TestRDocRIDriver < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_ri_driver.rb#L646 assert_match %r%^=== Implementation from Foo%, out end - def test_display_method_overriden + def test_display_method_overridden util_multi_store out, = capture_io do @@ -1455,10 +1455,10 @@ Foo::Bar#bother https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_ri_driver.rb#L1455 @inherit = @cFoo.add_method RDoc::AnyMethod.new(nil, 'inherit') @inherit.record_location @top_level - # overriden by Bar in multi_store - @overriden = @cFoo.add_method RDoc::AnyMethod.new(nil, 'override') - @overriden.comment = 'must not be displayed in Bar#override' - @overriden.record_location @top_level + # overridden by Bar in multi_store + @overridden = @cFoo.add_method RDoc::AnyMethod.new(nil, 'override') + @overridden.comment = 'must not be displayed in Bar#override' + @overridden.record_location @top_level @store1.save Index: test/rdoc/xref_test_case.rb =================================================================== --- test/rdoc/xref_test_case.rb (revision 57702) +++ test/rdoc/xref_test_case.rb (revision 57703) @@ -51,6 +51,7 @@ class XrefTestCase < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/xref_test_case.rb#L51 @c5_c1 = @xref_data.find_module_named 'C5::C1' @c3_h1 = @xref_data.find_module_named 'C3::H1' @c3_h2 = @xref_data.find_module_named 'C3::H2' + @c6 = @xref_data.find_module_named 'C6' @m1 = @xref_data.find_module_named 'M1' @m1_m = @m1.method_list.first Index: test/rdoc/test_rdoc_markdown_test.rb =================================================================== --- test/rdoc/test_rdoc_markdown_test.rb (revision 57702) +++ test/rdoc/test_rdoc_markdown_test.rb (revision 57703) @@ -601,7 +601,7 @@ foo https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_markdown_test.rb#L601 para("Unordered (bulleted) lists use asterisks, pluses, and hyphens (<code>*</code>,\n" + "<code>+</code>, and <code>-</code>) as list markers. These three markers are\n" + - "interchangable; this:"), + "interchangeable; this:"), verb("* Candy.\n", "* Gum.\n", @@ -1090,7 +1090,7 @@ foo https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_markdown_test.rb#L1090 para("Markdown supports ordered (numbered) and unordered (bulleted) lists."), - para("Unordered lists use asterisks, pluses, and hyphens -- interchangably\n" + + para("Unordered lists use asterisks, pluses, and hyphens -- interchangeably\n" + "-- as list markers:"), verb("* Red\n", Index: test/rdoc/test_rdoc_i18n_text.rb =================================================================== --- test/rdoc/test_rdoc_i18n_text.rb (revision 57702) +++ test/rdoc/test_rdoc_i18n_text.rb (revision 57703) @@ -59,7 +59,7 @@ Paragraphe 2. https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_i18n_text.rb#L59 assert_equal expected, translate(raw) end - def test_translate_not_transalted_message + def test_translate_not_translated_message nonexistent_paragraph = <<-PARAGRAPH.strip Nonexistent paragraph. PARAGRAPH Index: test/rdoc/xref_data.rb =================================================================== --- test/rdoc/xref_data.rb (revision 57702) +++ test/rdoc/xref_data.rb (revision 57703) @@ -57,6 +57,31 @@ class C5 https://github.com/ruby/ruby/blob/trunk/test/rdoc/xref_data.rb#L57 end end +class C6 + private def priv1() end + def pub1() end + protected def prot1() end + def pub2() end + public def pub3() end + def pub4() end + + private + private def priv2() end + def priv3() end + protected def prot2() end + def priv4() end + public def pub5() end + def priv5() end + + protected + private def priv6() end + def prot3() end + protected def prot4() end + def prot5() end + public def pub6() end + def prot6() end +end + module M1 def m end Index: test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text =================================================================== --- test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text (revision 57702) +++ test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text (revision 57703) @@ -298,7 +298,7 @@ Quote Level from the Text menu. https://github.com/ruby/ruby/blob/trunk/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text#L298 Markdown supports ordered (numbered) and unordered (bulleted) lists. -Unordered lists use asterisks, pluses, and hyphens -- interchangably +Unordered lists use asterisks, pluses, and hyphens -- interchangeably -- as list markers: * Red Index: test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text =================================================================== --- test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text (revision 57702) +++ test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text (revision 57703) @@ -123,7 +123,7 @@ Output: https://github.com/ruby/ruby/blob/trunk/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text#L123 Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, `+`, and `-`) as list markers. These three markers are -interchangable; this: +interchangeable; this: * Candy. * Gum. Index: test/rdoc/test_rdoc_context.rb =================================================================== --- test/rdoc/test_rdoc_context.rb (revision 57702) +++ test/rdoc/test_rdoc_context.rb (revision 57703) @@ -866,6 +866,27 @@ class TestRDocContext < XrefTestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_context.rb#L866 assert_equal [nil, 'Public', 'Internal'], titles end + def test_visibility_def + assert_equal :private, @c6.find_method_named('priv1').visibility + assert_equal :protected, @c6.find_method_named('prot1').visibility + assert_equal :public, @c6.find_method_named('pub1').visibility + assert_equal :private, @c6.find_method_named('priv2').visibility + assert_equal :protected, @c6.find_method_named('prot2').visibility + assert_equal :public, @c6.find_method_named('pub2').visibility + assert_equal :private, @c6.find_method_named('priv3').visibility + assert_equal :protected, @c6.find_method_named('prot3').visibility + assert_equal :public, @c6.find_method_named('pub3').visibility + assert_equal :private, @c6.find_method_named('priv4').visibility + assert_equal :protected, @c6.find_method_named('prot4').visibility + assert_equal :public, @c6.find_method_named('pub4').visibility + assert_equal :private, @c6.find_method_named('priv5').visibility + assert_equal :protected, @c6.find_method_named('prot5').visibility + assert_equal :public, @c6.find_method_named('pub5').visibility + assert_equal :private, @c6.find_method_named('priv6').visibility + assert_equal :protected, @c6.find_method_named('prot6').visibility + assert_equal :public, @c6.find_method_named('pub6').visibility + end + def util_visibilities @pub = RDoc::AnyMethod.new nil, 'pub' @prot = RDoc::AnyMethod.new nil, 'prot' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/