From 8186c3994e0cf1f91070176af66846d8f1556ec4 Mon Sep 17 00:00:00 2001 From: hsbt Date: Mon, 5 Sep 2016 10:35:30 +0000 Subject: * lib/rdoc/*, test/rdoc/*: Update rdoc/rdoc master(f191513) https://github.com/rdoc/rdoc/blob/master/History.rdoc#423--2016-- https://github.com/rdoc/rdoc/blob/master/History.rdoc#422--2016-02-09 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 + lib/rdoc.rb | 2 +- lib/rdoc/context.rb | 4 +- lib/rdoc/context/section.rb | 6 + lib/rdoc/encoding.rb | 13 + lib/rdoc/generator/template/darkfish/_head.rhtml | 3 +- lib/rdoc/generator/template/darkfish/css/fonts.css | 12 +- .../generator/template/darkfish/js/darkfish.js | 14 +- .../generator/template/json_index/js/searcher.js | 1 + lib/rdoc/markdown.rb | 9 +- lib/rdoc/parser/c.rb | 108 ++++-- lib/rdoc/parser/changelog.rb | 7 +- lib/rdoc/rd/block_parser.rb | 223 ++++++----- lib/rdoc/rd/inline_parser.rb | 413 ++++++++++----------- lib/rdoc/rdoc.gemspec | 65 +++- lib/rdoc/rdoc.rb | 2 +- lib/rdoc/ri/driver.rb | 19 +- lib/rdoc/ruby_lex.rb | 22 +- lib/rdoc/servlet.rb | 6 +- test/rdoc/test_rdoc_context.rb | 2 +- test/rdoc/test_rdoc_context_section.rb | 24 ++ test/rdoc/test_rdoc_encoding.rb | 39 ++ test/rdoc/test_rdoc_markup_to_html_crossref.rb | 6 + test/rdoc/test_rdoc_parser_c.rb | 44 +++ test/rdoc/test_rdoc_rdoc.rb | 1 + test/rdoc/test_rdoc_ri_driver.rb | 18 + test/rdoc/test_rdoc_servlet.rb | 19 +- 27 files changed, 667 insertions(+), 421 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f4d1b4466..8b6a459f43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Sep 5 19:35:22 2016 SHIBATA Hiroshi + + * lib/rdoc/*, test/rdoc/*: Update rdoc/rdoc master(f191513) + https://github.com/rdoc/rdoc/blob/master/History.rdoc#423--2016-- + https://github.com/rdoc/rdoc/blob/master/History.rdoc#422--2016-02-09 + Sun Sep 4 00:17:55 2016 Sho Hashimoto * proc.c: [DOC] fix Object#define_singleton_method and diff --git a/lib/rdoc.rb b/lib/rdoc.rb index d6e26114c0..494d5d9f4a 100644 --- a/lib/rdoc.rb +++ b/lib/rdoc.rb @@ -65,7 +65,7 @@ module RDoc ## # RDoc version you are using - VERSION = '4.2.1' + VERSION = '4.2.3' ## # Method visibilities diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb index bc8c8eecf1..6e5f464689 100644 --- a/lib/rdoc/context.rb +++ b/lib/rdoc/context.rb @@ -789,7 +789,9 @@ class RDoc::Context < RDoc::CodeObject # Finds a constant with +name+ in this context def find_constant_named(name) - @constants.find {|m| m.name == name} + @constants.find do |m| + m.name == name || m.full_name == name + end end ## diff --git a/lib/rdoc/context/section.rb b/lib/rdoc/context/section.rb index 90f184cb89..7c3c8c603d 100644 --- a/lib/rdoc/context/section.rb +++ b/lib/rdoc/context/section.rb @@ -58,6 +58,8 @@ class RDoc::Context::Section self.class === other and @title == other.title end + alias eql? == + ## # Adds +comment+ to this section @@ -128,6 +130,10 @@ class RDoc::Context::Section "#<%s:0x%x %p>" % [self.class, object_id, title] end + def hash # :nodoc: + @title.hash + end + ## # The files comments in this section come from diff --git a/lib/rdoc/encoding.rb b/lib/rdoc/encoding.rb index 5327f9a961..1056827937 100644 --- a/lib/rdoc/encoding.rb +++ b/lib/rdoc/encoding.rb @@ -74,10 +74,21 @@ module RDoc::Encoding nil end + def self.remove_frozen_string_literal string + string =~ /\A(?:#!.*\n)?(.*\n)/ + first_line = $1 + + if first_line =~ /\A# +frozen[-_]string[-_]literal[=:].+$/i + string.sub! first_line, '' + end + end + ## # Sets the encoding of +string+ based on the magic comment def self.set_encoding string + remove_frozen_string_literal string + string =~ /\A(?:#!.*\n)?(.*\n)/ first_line = $1 @@ -90,6 +101,8 @@ module RDoc::Encoding string.sub! first_line, '' + remove_frozen_string_literal string + return unless Object.const_defined? :Encoding enc = Encoding.find name diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml index 70f1c188d6..f308526823 100644 --- a/lib/rdoc/generator/template/darkfish/_head.rhtml +++ b/lib/rdoc/generator/template/darkfish/_head.rhtml @@ -3,7 +3,8 @@ <%= h @title %> diff --git a/lib/rdoc/generator/template/darkfish/css/fonts.css b/lib/rdoc/generator/template/darkfish/css/fonts.css index e9e721183b..57302b5183 100644 --- a/lib/rdoc/generator/template/darkfish/css/fonts.css +++ b/lib/rdoc/generator/template/darkfish/css/fonts.css @@ -17,7 +17,7 @@ font-weight: 400; src: local("Source Code Pro"), local("SourceCodePro-Regular"), - url("fonts/SourceCodePro-Regular.ttf") format("truetype"); + url("../fonts/SourceCodePro-Regular.ttf") format("truetype"); } @font-face { @@ -26,7 +26,7 @@ font-weight: 700; src: local("Source Code Pro Bold"), local("SourceCodePro-Bold"), - url("fonts/SourceCodePro-Bold.ttf") format("truetype"); + url("../fonts/SourceCodePro-Bold.ttf") format("truetype"); } /* @@ -46,7 +46,7 @@ font-weight: 300; src: local("Lato Light"), local("Lato-Light"), - url("fonts/Lato-Light.ttf") format("truetype"); + url("../fonts/Lato-Light.ttf") format("truetype"); } @font-face { @@ -55,7 +55,7 @@ font-weight: 300; src: local("Lato Light Italic"), local("Lato-LightItalic"), - url("fonts/Lato-LightItalic.ttf") format("truetype"); + url("../fonts/Lato-LightItalic.ttf") format("truetype"); } @font-face { @@ -64,7 +64,7 @@ font-weight: 700; src: local("Lato Regular"), local("Lato-Regular"), - url("fonts/Lato-Regular.ttf") format("truetype"); + url("../fonts/Lato-Regular.ttf") format("truetype"); } @font-face { @@ -73,7 +73,7 @@ font-weight: 700; src: local("Lato Italic"), local("Lato-Italic"), - url("fonts/Lato-RegularItalic.ttf") format("truetype"); + url("../fonts/Lato-RegularItalic.ttf") format("truetype"); } /* diff --git a/lib/rdoc/generator/template/darkfish/js/darkfish.js b/lib/rdoc/generator/template/darkfish/js/darkfish.js index b789a65631..38f877ed40 100644 --- a/lib/rdoc/generator/template/darkfish/js/darkfish.js +++ b/lib/rdoc/generator/template/darkfish/js/darkfish.js @@ -59,7 +59,7 @@ function hookSearch() { var html = ''; // TODO add relative path to