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