summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/rdoc.rb2
-rw-r--r--lib/rdoc/.document1
-rw-r--r--lib/rdoc/context.rb3
-rw-r--r--lib/rdoc/generator.rb1
-rw-r--r--lib/rdoc/generator/template/darkfish/_footer.rhtml2
-rw-r--r--lib/rdoc/markdown.rb3
-rw-r--r--lib/rdoc/markdown/literals.rb24
-rw-r--r--lib/rdoc/markup/pre_process.rb5
-rw-r--r--lib/rdoc/markup/to_bs.rb2
-rw-r--r--lib/rdoc/options.rb13
-rw-r--r--lib/rdoc/parser.rb25
-rw-r--r--lib/rdoc/rdoc.gemspec32
-rw-r--r--lib/rdoc/rdoc.rb12
-rw-r--r--lib/rdoc/ri/driver.rb2
-rw-r--r--lib/rdoc/ruby_lex.rb6
-rw-r--r--lib/rdoc/rubygems_hook.rb10
-rw-r--r--lib/rdoc/stats/normal.rb12
-rw-r--r--lib/rdoc/store.rb7
-rw-r--r--lib/rdoc/test_case.rb2
-rw-r--r--test/rdoc/test_rdoc_context.rb14
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb3
-rw-r--r--test/rdoc/test_rdoc_parser.rb2
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb2
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb8
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb4
-rw-r--r--test/rdoc/test_rdoc_store.rb6
27 files changed, 63 insertions, 145 deletions
diff --git a/ChangeLog b/ChangeLog
index 6423239fc4..c96a81a134 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Nov 5 18:17:08 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0
+ Release note: https://github.com/rdoc/rdoc/blob/b825775647f62c5b525e9780a28ff2fbb1d5bf6f/History.rdoc#500--2016-11-05
+
Sat Nov 5 17:29:06 2016 Tanaka Akira <akr@fsij.org>
* lib/resolv.rb (Resolv::DNS#extract_resources): Use each_resource
diff --git a/lib/rdoc.rb b/lib/rdoc.rb
index cf909d1699..18b8fcb9f3 100644
--- a/lib/rdoc.rb
+++ b/lib/rdoc.rb
@@ -65,7 +65,7 @@ module RDoc
##
# RDoc version you are using
- VERSION = '5.0.0.beta2'
+ VERSION = '5.0.0'
##
# Method visibilities
diff --git a/lib/rdoc/.document b/lib/rdoc/.document
new file mode 100644
index 0000000000..41333c6411
--- /dev/null
+++ b/lib/rdoc/.document
@@ -0,0 +1 @@
+*.rb
diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb
index 6e5f464689..dc34c3f34b 100644
--- a/lib/rdoc/context.rb
+++ b/lib/rdoc/context.rb
@@ -327,7 +327,7 @@ class RDoc::Context < RDoc::CodeObject
if full_name == 'BasicObject' then
superclass = nil
elsif full_name == 'Object' then
- superclass = defined?(::BasicObject) ? '::BasicObject' : nil
+ superclass = '::BasicObject'
end
# find the superclass full name
@@ -1211,4 +1211,3 @@ class RDoc::Context < RDoc::CodeObject
autoload :Section, 'rdoc/context/section'
end
-
diff --git a/lib/rdoc/generator.rb b/lib/rdoc/generator.rb
index d37d1db61f..6efc5e4474 100644
--- a/lib/rdoc/generator.rb
+++ b/lib/rdoc/generator.rb
@@ -49,4 +49,3 @@ module RDoc::Generator
autoload :POT, 'rdoc/generator/pot'
end
-
diff --git a/lib/rdoc/generator/template/darkfish/_footer.rhtml b/lib/rdoc/generator/template/darkfish/_footer.rhtml
index fe5822cc6b..7c4debd1f7 100644
--- a/lib/rdoc/generator/template/darkfish/_footer.rhtml
+++ b/lib/rdoc/generator/template/darkfish/_footer.rhtml
@@ -1,5 +1,5 @@
<footer id="validator-badges" role="contentinfo">
<p><a href="http://validator.w3.org/check/referer">Validate</a>
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> <%= RDoc::VERSION %>.
+ <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> <%= RDoc::VERSION %>.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>
diff --git a/lib/rdoc/markdown.rb b/lib/rdoc/markdown.rb
index 06fe8cf4d4..9b433b3ee6 100644
--- a/lib/rdoc/markdown.rb
+++ b/lib/rdoc/markdown.rb
@@ -521,7 +521,6 @@ class RDoc::Markdown
- require 'rubygems'
require 'rdoc'
require 'rdoc/markup/to_joined_paragraph'
require 'rdoc/markdown/entities'
@@ -15281,7 +15280,7 @@ class RDoc::Markdown
self.pos = _save
break
end
- @result = begin;
+ @result = begin;
ref = [:inline, @note_order.length]
@footnotes[ref] = paragraph a
diff --git a/lib/rdoc/markdown/literals.rb b/lib/rdoc/markdown/literals.rb
index cde761a2f7..b6bb89e0c6 100644
--- a/lib/rdoc/markdown/literals.rb
+++ b/lib/rdoc/markdown/literals.rb
@@ -183,26 +183,14 @@ class RDoc::Markdown::Literals
return nil
end
- if "".respond_to? :ord
- def get_byte
- if @pos >= @string_size
- return nil
- end
-
- s = @string[@pos].ord
- @pos += 1
- s
+ def get_byte
+ if @pos >= @string_size
+ return nil
end
- else
- def get_byte
- if @pos >= @string_size
- return nil
- end
- s = @string[@pos]
- @pos += 1
- s
- end
+ s = @string[@pos].ord
+ @pos += 1
+ s
end
def parse(rule=nil)
diff --git a/lib/rdoc/markup/pre_process.rb b/lib/rdoc/markup/pre_process.rb
index d7cef36158..6ce523be89 100644
--- a/lib/rdoc/markup/pre_process.rb
+++ b/lib/rdoc/markup/pre_process.rb
@@ -102,8 +102,6 @@ class RDoc::Markup::PreProcess
text = text.text
end
- encoding = text.encoding if defined?(Encoding)
-
# regexp helper (square brackets for optional)
# $1 $2 $3 $4 $5
# [prefix][\]:directive:[spaces][param]newline
@@ -122,7 +120,7 @@ class RDoc::Markup::PreProcess
next "#{$1.strip}\n"
end
- handle_directive $1, $3, $5, code_object, encoding, &block
+ handle_directive $1, $3, $5, code_object, text.encoding, &block
end
comment = text unless comment
@@ -291,4 +289,3 @@ class RDoc::Markup::PreProcess
end
end
-
diff --git a/lib/rdoc/markup/to_bs.rb b/lib/rdoc/markup/to_bs.rb
index d55f64c5e7..9a1c7c6ccd 100644
--- a/lib/rdoc/markup/to_bs.rb
+++ b/lib/rdoc/markup/to_bs.rb
@@ -64,7 +64,6 @@ class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc
# Adds bold or underline mixed with backspaces
def convert_string string
- return string unless string.respond_to? :chars # your ruby is lame
return string unless @in_b or @in_em
chars = if @in_b then
string.chars.map do |char| "#{char}\b#{char}" end
@@ -76,4 +75,3 @@ class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc
end
end
-
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb
index 2bc7474eb0..60cfb5e553 100644
--- a/lib/rdoc/options.rb
+++ b/lib/rdoc/options.rb
@@ -1187,19 +1187,6 @@ Usage: #{opt.program_name} [options] [names...]
end
end
- ##
- # This is compatibility code for syck
-
- def to_yaml opts = {} # :nodoc:
- return super if YAML.const_defined?(:ENGINE) and not YAML::ENGINE.syck?
-
- YAML.quick_emit self, opts do |out|
- out.map taguri, to_yaml_style do |map|
- encode_with map
- end
- end
- end
-
# Sets the minimum visibility of a documented method.
#
# Accepts +:public+, +:protected+, +:private+, +:nodoc+, or +:all+.
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb
index 9c207edcff..5abc374bf7 100644
--- a/lib/rdoc/parser.rb
+++ b/lib/rdoc/parser.rb
@@ -76,25 +76,15 @@ class RDoc::Parser
s = File.read(file, 1024) or return false
- have_encoding = s.respond_to? :encoding
-
return true if s[0, 2] == Marshal.dump('')[0, 2] or s.index("\x00")
- if have_encoding then
- mode = "r"
- 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
- s = File.open(file, mode) {|f| f.gets(nil, 1024)}
-
- not s.valid_encoding?
- else
- if 0.respond_to? :fdiv then
- s.count("\x00-\x7F", "^ -~\t\r\n").fdiv(s.size) > 0.3
- else # HACK 1.8.6
- (s.count("\x00-\x7F", "^ -~\t\r\n").to_f / s.size) > 0.3
- end
- end
+ mode = "r"
+ 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
+ s = File.open(file, mode) {|f| f.gets(nil, 1024)}
+
+ not s.valid_encoding?
end
##
@@ -308,4 +298,3 @@ require 'rdoc/parser/changelog'
require 'rdoc/parser/markdown'
require 'rdoc/parser/rd'
require 'rdoc/parser/ruby'
-
diff --git a/lib/rdoc/rdoc.gemspec b/lib/rdoc/rdoc.gemspec
index 81ba52f4d0..e605560868 100644
--- a/lib/rdoc/rdoc.gemspec
+++ b/lib/rdoc/rdoc.gemspec
@@ -6,9 +6,6 @@ Gem::Specification.new do |s|
s.name = "rdoc"
s.version = RDoc::VERSION
- s.required_rubygems_version = Gem::Requirement.new(">= 1.3")
-
- s.require_paths = ["lib"]
s.authors = [
"Eric Hodel",
"Dave Thomas",
@@ -17,17 +14,25 @@ Gem::Specification.new do |s|
"Zachary Scott",
"Hiroshi SHIBATA"
]
+ s.email = ["drbrain@segment7.net", "", "", "", "mail@zzak.io", "hsbt@ruby-lang.org"]
+ s.summary = "RDoc produces HTML and command-line documentation for Ruby projects"
s.description = <<-DESCRIPTION
RDoc produces HTML and command-line documentation for Ruby projects.
RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentation from the command-line.
DESCRIPTION
-
- s.email = ["drbrain@segment7.net", "mail@zzak.io", "hsbt@ruby-lang.org"]
+ s.homepage = "https://rdoc.github.io/rdoc"
+ s.licenses = ["Ruby"]
s.bindir = "exe"
s.executables = ["rdoc", "ri"]
+ s.require_paths = ["lib"]
+ # for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
+ s.files = [".document", ".gitignore", ".travis.yml", "CONTRIBUTING.rdoc", "CVE-2013-0256.rdoc", "ExampleMarkdown.md", "ExampleRDoc.rdoc", "Gemfile", "History.rdoc", "LEGAL.rdoc", "LICENSE.rdoc", "README.rdoc", "RI.rdoc", "Rakefile", "TODO.rdoc", "bin/console", "bin/setup", "exe/rdoc", "exe/ri", "lib/gauntlet_rdoc.rb", "lib/rdoc.rb", "lib/rdoc/alias.rb", "lib/rdoc/anon_class.rb", "lib/rdoc/any_method.rb", "lib/rdoc/attr.rb", "lib/rdoc/class_module.rb", "lib/rdoc/code_object.rb", "lib/rdoc/code_objects.rb", "lib/rdoc/comment.rb", "lib/rdoc/constant.rb", "lib/rdoc/context.rb", "lib/rdoc/context/section.rb", "lib/rdoc/cross_reference.rb", "lib/rdoc/encoding.rb", "lib/rdoc/erb_partial.rb", "lib/rdoc/erbio.rb", "lib/rdoc/extend.rb", "lib/rdoc/generator.rb", "lib/rdoc/generator/darkfish.rb", "lib/rdoc/generator/json_index.rb", "lib/rdoc/generator/markup.rb", "lib/rdoc/generator/pot.rb", "lib/rdoc/generator/pot/message_extractor.rb", "lib/rdoc/generator/pot/po.rb", "lib/rdoc/generator/pot/po_entry.rb", "lib/rdoc/generator/ri.rb", "lib/rdoc/generator/template/darkfish/.document", "lib/rdoc/generator/template/darkfish/_footer.rhtml", "lib/rdoc/generator/template/darkfish/_head.rhtml","lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml", "lib/rdoc/generator/template/darkfish/class.rhtml", "lib/rdoc/generator/template/darkfish/css/fonts.css", "lib/rdoc/generator/template/darkfish/css/rdoc.css", "lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf", "lib/rdoc/generator/template/darkfish/images/add.png", "lib/rdoc/generator/template/darkfish/images/arrow_up.png", "lib/rdoc/generator/template/darkfish/images/brick.png", "lib/rdoc/generator/template/darkfish/images/brick_link.png", "lib/rdoc/generator/template/darkfish/images/bug.png", "lib/rdoc/generator/template/darkfish/images/bullet_black.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png", "lib/rdoc/generator/template/darkfish/images/date.png", "lib/rdoc/generator/template/darkfish/images/delete.png", "lib/rdoc/generator/template/darkfish/images/find.png", "lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif", "lib/rdoc/generator/template/darkfish/images/macFFBgHack.png", "lib/rdoc/generator/template/darkfish/images/package.png", "lib/rdoc/generator/template/darkfish/images/page_green.png", "lib/rdoc/generator/template/darkfish/images/page_white_text.png", "lib/rdoc/generator/template/darkfish/images/page_white_width.png", "lib/rdoc/generator/template/darkfish/images/plugin.png", "lib/rdoc/generator/template/darkfish/images/ruby.png", "lib/rdoc/generator/template/darkfish/images/tag_blue.png", "lib/rdoc/generator/template/darkfish/images/tag_green.png", "lib/rdoc/generator/template/darkfish/images/transparent.png", "lib/rdoc/generator/template/darkfish/images/wrench.png", "lib/rdoc/generator/template/darkfish/images/wrench_orange.png", "lib/rdoc/generator/template/darkfish/images/zoom.png", "lib/rdoc/generator/template/darkfish/index.rhtml", "lib/rdoc/generator/template/darkfish/js/darkfish.js", "lib/rdoc/generator/template/darkfish/js/jquery.js", "lib/rdoc/generator/template/darkfish/js/search.js", "lib/rdoc/generator/template/darkfish/page.rhtml", "lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml", "lib/rdoc/generator/template/darkfish/servlet_root.rhtml", "lib/rdoc/generator/template/darkfish/table_of_contents.rhtml", "lib/rdoc/generator/template/json_index/.document", "lib/rdoc/generator/template/json_index/js/navigation.js", "lib/rdoc/generator/template/json_index/js/searcher.js", "lib/rdoc/ghost_method.rb", "lib/rdoc/i18n.rb", "lib/rdoc/i18n/locale.rb", "lib/rdoc/i18n/text.rb", "lib/rdoc/include.rb", "lib/rdoc/known_classes.rb", "lib/rdoc/markdown.kpeg", "lib/rdoc/markdown/entities.rb", "lib/rdoc/markdown/literals.kpeg", "lib/rdoc/markdown/literals.rb", "lib/rdoc/markup.rb", "lib/rdoc/markup/attr_changer.rb", "lib/rdoc/markup/attr_span.rb", "lib/rdoc/markup/attribute_manager.rb", "lib/rdoc/markup/attributes.rb", "lib/rdoc/markup/blank_line.rb", "lib/rdoc/markup/block_quote.rb", "lib/rdoc/markup/document.rb", "lib/rdoc/markup/formatter.rb", "lib/rdoc/markup/formatter_test_case.rb", "lib/rdoc/markup/hard_break.rb", "lib/rdoc/markup/heading.rb", "lib/rdoc/markup/include.rb", "lib/rdoc/markup/indented_paragraph.rb", "lib/rdoc/markup/inline.rb", "lib/rdoc/markup/list.rb", "lib/rdoc/markup/list_item.rb", "lib/rdoc/markup/paragraph.rb", "lib/rdoc/markup/parser.rb", "lib/rdoc/markup/pre_process.rb", "lib/rdoc/markup/raw.rb", "lib/rdoc/markup/rule.rb", "lib/rdoc/markup/special.rb", "lib/rdoc/markup/text_formatter_test_case.rb", "lib/rdoc/markup/to_ansi.rb", "lib/rdoc/markup/to_bs.rb", "lib/rdoc/markup/to_html.rb", "lib/rdoc/markup/to_html_crossref.rb", "lib/rdoc/markup/to_html_snippet.rb", "lib/rdoc/markup/to_joined_paragraph.rb", "lib/rdoc/markup/to_label.rb", "lib/rdoc/markup/to_markdown.rb", "lib/rdoc/markup/to_rdoc.rb", "lib/rdoc/markup/to_table_of_contents.rb", "lib/rdoc/markup/to_test.rb", "lib/rdoc/markup/to_tt_only.rb", "lib/rdoc/markup/verbatim.rb", "lib/rdoc/meta_method.rb", "lib/rdoc/method_attr.rb", "lib/rdoc/mixin.rb", "lib/rdoc/normal_class.rb", "lib/rdoc/normal_module.rb", "lib/rdoc/options.rb", "lib/rdoc/parser.rb", "lib/rdoc/parser/c.rb", "lib/rdoc/parser/changelog.rb", "lib/rdoc/parser/markdown.rb", "lib/rdoc/parser/rd.rb", "lib/rdoc/parser/ruby.rb", "lib/rdoc/parser/ruby_tools.rb", "lib/rdoc/parser/simple.rb", "lib/rdoc/parser/text.rb", "lib/rdoc/rd.rb", "lib/rdoc/rd/block_parser.ry", "lib/rdoc/rd/inline.rb", "lib/rdoc/rd/inline_parser.ry", "lib/rdoc/rdoc.rb", "lib/rdoc/require.rb", "lib/rdoc/ri.rb", "lib/rdoc/ri/driver.rb", "lib/rdoc/ri/formatter.rb", "lib/rdoc/ri/paths.rb", "lib/rdoc/ri/store.rb", "lib/rdoc/ri/task.rb", "lib/rdoc/ruby_lex.rb", "lib/rdoc/ruby_token.rb", "lib/rdoc/rubygems_hook.rb", "lib/rdoc/servlet.rb", "lib/rdoc/single_class.rb", "lib/rdoc/stats.rb", "lib/rdoc/stats/normal.rb", "lib/rdoc/stats/quiet.rb", "lib/rdoc/stats/verbose.rb", "lib/rdoc/store.rb", "lib/rdoc/task.rb", "lib/rdoc/test_case.rb", "lib/rdoc/text.rb", "lib/rdoc/token_stream.rb", "lib/rdoc/tom_doc.rb", "lib/rdoc/top_level.rb", "rdoc.gemspec"]
+ # files from .gitignore
+ s.files << "lib/rdoc/rd/block_parser.rb" << "lib/rdoc/rd/inline_parser.rb" << "lib/rdoc/markdown.rb"
+ s.rdoc_options = ["--main", "README.rdoc"]
s.extra_rdoc_files += %w[
CVE-2013-0256.rdoc
CONTRIBUTING.rdoc
@@ -41,21 +46,12 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
TODO.rdoc
]
- # for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- s.files = [".autotest", ".document", ".gitignore", ".travis.yml", "CONTRIBUTING.rdoc", "CVE-2013-0256.rdoc", "ExampleMarkdown.md", "ExampleRDoc.rdoc", "Gemfile", "History.rdoc", "LEGAL.rdoc", "LICENSE.rdoc", "README.rdoc", "RI.rdoc", "Rakefile", "TODO.rdoc", "bin/console", "bin/setup", "exe/rdoc", "exe/ri", "lib/gauntlet_rdoc.rb", "lib/rdoc.rb", "lib/rdoc/alias.rb", "lib/rdoc/anon_class.rb", "lib/rdoc/any_method.rb", "lib/rdoc/attr.rb", "lib/rdoc/class_module.rb", "lib/rdoc/code_object.rb", "lib/rdoc/code_objects.rb", "lib/rdoc/comment.rb", "lib/rdoc/constant.rb", "lib/rdoc/context.rb", "lib/rdoc/context/section.rb", "lib/rdoc/cross_reference.rb", "lib/rdoc/encoding.rb", "lib/rdoc/erb_partial.rb", "lib/rdoc/erbio.rb", "lib/rdoc/extend.rb", "lib/rdoc/generator.rb", "lib/rdoc/generator/darkfish.rb", "lib/rdoc/generator/json_index.rb", "lib/rdoc/generator/markup.rb", "lib/rdoc/generator/pot.rb", "lib/rdoc/generator/pot/message_extractor.rb", "lib/rdoc/generator/pot/po.rb", "lib/rdoc/generator/pot/po_entry.rb", "lib/rdoc/generator/ri.rb", "lib/rdoc/generator/template/darkfish/.document", "lib/rdoc/generator/template/darkfish/_footer.rhtml", "lib/rdoc/generator/template/darkfish/_head.rhtml","lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml", "lib/rdoc/generator/template/darkfish/class.rhtml", "lib/rdoc/generator/template/darkfish/css/fonts.css", "lib/rdoc/generator/template/darkfish/css/rdoc.css", "lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf", "lib/rdoc/generator/template/darkfish/images/add.png", "lib/rdoc/generator/template/darkfish/images/arrow_up.png", "lib/rdoc/generator/template/darkfish/images/brick.png", "lib/rdoc/generator/template/darkfish/images/brick_link.png", "lib/rdoc/generator/template/darkfish/images/bug.png", "lib/rdoc/generator/template/darkfish/images/bullet_black.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png", "lib/rdoc/generator/template/darkfish/images/date.png", "lib/rdoc/generator/template/darkfish/images/delete.png", "lib/rdoc/generator/template/darkfish/images/find.png", "lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif", "lib/rdoc/generator/template/darkfish/images/macFFBgHack.png", "lib/rdoc/generator/template/darkfish/images/package.png", "lib/rdoc/generator/template/darkfish/images/page_green.png", "lib/rdoc/generator/template/darkfish/images/page_white_text.png", "lib/rdoc/generator/template/darkfish/images/page_white_width.png", "lib/rdoc/generator/template/darkfish/images/plugin.png", "lib/rdoc/generator/template/darkfish/images/ruby.png", "lib/rdoc/generator/template/darkfish/images/tag_blue.png", "lib/rdoc/generator/template/darkfish/images/tag_green.png", "lib/rdoc/generator/template/darkfish/images/transparent.png", "lib/rdoc/generator/template/darkfish/images/wrench.png", "lib/rdoc/generator/template/darkfish/images/wrench_orange.png", "lib/rdoc/generator/template/darkfish/images/zoom.png", "lib/rdoc/generator/template/darkfish/index.rhtml", "lib/rdoc/generator/template/darkfish/js/darkfish.js", "lib/rdoc/generator/template/darkfish/js/jquery.js", "lib/rdoc/generator/template/darkfish/js/search.js", "lib/rdoc/generator/template/darkfish/page.rhtml", "lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml", "lib/rdoc/generator/template/darkfish/servlet_root.rhtml", "lib/rdoc/generator/template/darkfish/table_of_contents.rhtml", "lib/rdoc/generator/template/json_index/.document", "lib/rdoc/generator/template/json_index/js/navigation.js", "lib/rdoc/generator/template/json_index/js/searcher.js", "lib/rdoc/ghost_method.rb", "lib/rdoc/i18n.rb", "lib/rdoc/i18n/locale.rb", "lib/rdoc/i18n/text.rb", "lib/rdoc/include.rb", "lib/rdoc/known_classes.rb", "lib/rdoc/markdown.kpeg", "lib/rdoc/markdown/entities.rb", "lib/rdoc/markdown/literals.kpeg", "lib/rdoc/markdown/literals.rb", "lib/rdoc/markup.rb", "lib/rdoc/markup/attr_changer.rb", "lib/rdoc/markup/attr_span.rb", "lib/rdoc/markup/attribute_manager.rb", "lib/rdoc/markup/attributes.rb", "lib/rdoc/markup/blank_line.rb", "lib/rdoc/markup/block_quote.rb", "lib/rdoc/markup/document.rb", "lib/rdoc/markup/formatter.rb", "lib/rdoc/markup/formatter_test_case.rb", "lib/rdoc/markup/hard_break.rb", "lib/rdoc/markup/heading.rb", "lib/rdoc/markup/include.rb", "lib/rdoc/markup/indented_paragraph.rb", "lib/rdoc/markup/inline.rb", "lib/rdoc/markup/list.rb", "lib/rdoc/markup/list_item.rb", "lib/rdoc/markup/paragraph.rb", "lib/rdoc/markup/parser.rb", "lib/rdoc/markup/pre_process.rb", "lib/rdoc/markup/raw.rb", "lib/rdoc/markup/rule.rb", "lib/rdoc/markup/special.rb", "lib/rdoc/markup/text_formatter_test_case.rb", "lib/rdoc/markup/to_ansi.rb", "lib/rdoc/markup/to_bs.rb", "lib/rdoc/markup/to_html.rb", "lib/rdoc/markup/to_html_crossref.rb", "lib/rdoc/markup/to_html_snippet.rb", "lib/rdoc/markup/to_joined_paragraph.rb", "lib/rdoc/markup/to_label.rb", "lib/rdoc/markup/to_markdown.rb", "lib/rdoc/markup/to_rdoc.rb", "lib/rdoc/markup/to_table_of_contents.rb", "lib/rdoc/markup/to_test.rb", "lib/rdoc/markup/to_tt_only.rb", "lib/rdoc/markup/verbatim.rb", "lib/rdoc/meta_method.rb", "lib/rdoc/method_attr.rb", "lib/rdoc/mixin.rb", "lib/rdoc/normal_class.rb", "lib/rdoc/normal_module.rb", "lib/rdoc/options.rb", "lib/rdoc/parser.rb", "lib/rdoc/parser/c.rb", "lib/rdoc/parser/changelog.rb", "lib/rdoc/parser/markdown.rb", "lib/rdoc/parser/rd.rb", "lib/rdoc/parser/ruby.rb", "lib/rdoc/parser/ruby_tools.rb", "lib/rdoc/parser/simple.rb", "lib/rdoc/parser/text.rb", "lib/rdoc/rd.rb", "lib/rdoc/rd/block_parser.ry", "lib/rdoc/rd/inline.rb", "lib/rdoc/rd/inline_parser.ry", "lib/rdoc/rdoc.rb", "lib/rdoc/require.rb", "lib/rdoc/ri.rb", "lib/rdoc/ri/driver.rb", "lib/rdoc/ri/formatter.rb", "lib/rdoc/ri/paths.rb", "lib/rdoc/ri/store.rb", "lib/rdoc/ri/task.rb", "lib/rdoc/ruby_lex.rb", "lib/rdoc/ruby_token.rb", "lib/rdoc/rubygems_hook.rb", "lib/rdoc/servlet.rb", "lib/rdoc/single_class.rb", "lib/rdoc/stats.rb", "lib/rdoc/stats/normal.rb", "lib/rdoc/stats/quiet.rb", "lib/rdoc/stats/verbose.rb", "lib/rdoc/store.rb", "lib/rdoc/task.rb", "lib/rdoc/test_case.rb", "lib/rdoc/text.rb", "lib/rdoc/token_stream.rb", "lib/rdoc/tom_doc.rb", "lib/rdoc/top_level.rb", "rdoc.gemspec"]
- # files from .gitignore
- s.files << "lib/rdoc/rd/block_parser.rb" << "lib/rdoc/rd/inline_parser.rb" << "lib/rdoc/markdown.rb"
-
- s.homepage = "http://docs.seattlerb.org/rdoc"
- s.licenses = ["Ruby"]
-
- s.rdoc_options = ["--main", "README.rdoc"]
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
s.rubygems_version = "2.5.2"
- s.summary = "RDoc produces HTML and command-line documentation for Ruby projects"
+ s.required_rubygems_version = Gem::Requirement.new(">= 2.2")
- s.add_development_dependency("rake", "~> 10.5")
- s.add_development_dependency("racc", "~> 1.4", "> 1.4.10")
- s.add_development_dependency("kpeg", "~> 0.9")
+ s.add_development_dependency("rake")
+ s.add_development_dependency("racc", "> 1.4.10")
+ s.add_development_dependency("kpeg")
s.add_development_dependency("minitest", "~> 4")
end
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb
index ec50d8eba5..adcb65b13b 100644
--- a/lib/rdoc/rdoc.rb
+++ b/lib/rdoc/rdoc.rb
@@ -161,15 +161,9 @@ class RDoc::RDoc
RDoc.load_yaml
- parse_error = if Object.const_defined? :Psych then
- Psych::SyntaxError
- else
- ArgumentError
- end
-
begin
options = YAML.load_file '.rdoc_options'
- rescue *parse_error
+ rescue Psych::SyntaxError
end
raise RDoc::Error, "#{options_file} is not a valid rdoc options file" unless
@@ -417,6 +411,7 @@ The internal error was:
return [] if file_list.empty?
+ original_options = @options.dup
@stats.begin_adding
file_info = file_list.map do |filename|
@@ -425,6 +420,7 @@ The internal error was:
end.compact
@stats.done_adding
+ @options = original_options
file_info
end
@@ -479,7 +475,7 @@ The internal error was:
@last_modified = setup_output_dir @options.op_dir, @options.force_update
end
- @store.encoding = @options.encoding if @options.respond_to? :encoding
+ @store.encoding = @options.encoding
@store.dry_run = @options.dry_run
@store.main = @options.main_page
@store.title = @options.title
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index 7942406ceb..23d24e9a20 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -1428,7 +1428,7 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the
def setup_pager
return if @use_stdout
- jruby = Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
+ jruby = RUBY_ENGINE == 'jruby'
pagers = [ENV['RI_PAGER'], ENV['PAGER'], 'pager', 'less', 'more']
diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb
index 25788b6a29..1fc3c12c4a 100644
--- a/lib/rdoc/ruby_lex.rb
+++ b/lib/rdoc/ruby_lex.rb
@@ -853,11 +853,7 @@ class RDoc::RubyLex
end
end
- IDENT_RE = if defined? Encoding then
- eval '/[\w\u{0080}-\u{FFFFF}]/u' # 1.8 can't parse \u{}
- else
- /[\w\x80-\xFF]/
- end
+ IDENT_RE = eval '/[\w\u{0080}-\u{FFFFF}]/u'
def identify_identifier
token = ""
diff --git a/lib/rdoc/rubygems_hook.rb b/lib/rdoc/rubygems_hook.rb
index e2afb1fa91..e9351b7280 100644
--- a/lib/rdoc/rubygems_hook.rb
+++ b/lib/rdoc/rubygems_hook.rb
@@ -153,13 +153,7 @@ class RDoc::RubygemsHook
options = nil
args = @spec.rdoc_options
-
- if @spec.respond_to? :source_paths then
- args.concat @spec.source_paths
- else
- args.concat @spec.require_paths
- end
-
+ args.concat @spec.source_paths
args.concat @spec.extra_rdoc_files
case config_args = Gem.configuration[:rdoc]
@@ -183,7 +177,7 @@ class RDoc::RubygemsHook
@rdoc.options = options
store = RDoc::Store.new
- store.encoding = options.encoding if options.respond_to? :encoding
+ store.encoding = options.encoding
store.dry_run = options.dry_run
store.main = options.main_page
store.title = options.title
diff --git a/lib/rdoc/stats/normal.rb b/lib/rdoc/stats/normal.rb
index f32db48005..ba00b6cbdf 100644
--- a/lib/rdoc/stats/normal.rb
+++ b/lib/rdoc/stats/normal.rb
@@ -1,8 +1,5 @@
# frozen_string_literal: false
-begin
- require 'io/console/size'
-rescue LoadError
-end
+require 'io/console/size'
##
# Stats printer that prints just the files being documented with a progress
@@ -26,11 +23,7 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet
# Print a progress bar, but make sure it fits on a single line. Filename
# will be truncated if necessary.
- terminal_width = if defined?(IO) && IO.respond_to?(:console_size)
- IO.console_size[1].to_i.nonzero? || 80
- else
- 80
- end
+ terminal_width = IO.console_size[1].to_i.nonzero? || 80
max_filename_size = terminal_width - progress_bar.size
if filename.size > max_filename_size then
@@ -57,4 +50,3 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet
end
end
-
diff --git a/lib/rdoc/store.rb b/lib/rdoc/store.rb
index 37bf03fc24..aaefff8f13 100644
--- a/lib/rdoc/store.rb
+++ b/lib/rdoc/store.rb
@@ -679,12 +679,7 @@ class RDoc::Store
method_name =~ /#(.*)/
method_type = $1 ? 'i' : 'c'
method_name = $1 if $1
-
- method_name = if ''.respond_to? :ord then
- method_name.gsub(/\W/) { "%%%02x" % $&[0].ord }
- else
- method_name.gsub(/\W/) { "%%%02x" % $&[0] }
- end
+ method_name = method_name.gsub(/\W/) { "%%%02x" % $&[0].ord }
File.join class_path(klass_name), "#{method_name}-#{method_type}.ri"
end
diff --git a/lib/rdoc/test_case.rb b/lib/rdoc/test_case.rb
index 7c80ecdf9c..aa7120cb59 100644
--- a/lib/rdoc/test_case.rb
+++ b/lib/rdoc/test_case.rb
@@ -141,7 +141,7 @@ class RDoc::TestCase < MiniTest::Unit::TestCase
def mu_pp obj # :nodoc:
s = ''
s = PP.pp obj, s
- s = s.force_encoding Encoding.default_external if defined? Encoding
+ s = s.force_encoding Encoding.default_external
s.chomp
end
diff --git a/test/rdoc/test_rdoc_context.rb b/test/rdoc/test_rdoc_context.rb
index 7b700bc234..cc9ab3650f 100644
--- a/test/rdoc/test_rdoc_context.rb
+++ b/test/rdoc/test_rdoc_context.rb
@@ -8,9 +8,6 @@ class TestRDocContext < XrefTestCase
@context = RDoc::Context.new
@context.store = @store
-
- @enumerator = # 1.8 vs 1.9
- Object.const_defined?(:Enumerator) ? Enumerator : Enumerable::Enumerator
end
def test_initialize
@@ -118,8 +115,6 @@ class TestRDocContext < XrefTestCase
end
def test_add_class_basic_object
- skip 'BasicObject is 1.9 only' unless defined?(BasicObject)
-
@xref_data.add_class RDoc::NormalClass, 'BasicObject'
basic = @xref_data.find_module_named 'BasicObject'
@@ -134,13 +129,11 @@ class TestRDocContext < XrefTestCase
end
def test_add_class_object
- root_class = defined?(BasicObject) ? 'BasicObject' : nil
-
@xref_data.add_class RDoc::NormalClass, 'Object'
object = @xref_data.find_module_named 'Object'
- assert_equal root_class, object.superclass
+ assert_equal 'BasicObject', object.superclass
@c1.add_class RDoc::NormalClass, 'Object'
@@ -457,7 +450,7 @@ class TestRDocContext < XrefTestCase
end
def test_each_method_enumerator
- assert_kind_of @enumerator, @c1.each_method
+ assert_kind_of Enumerator, @c1.each_method
end
def test_each_section
@@ -489,7 +482,7 @@ class TestRDocContext < XrefTestCase
end
def test_each_section_enumerator
- assert_kind_of @enumerator, @c1.each_section
+ assert_kind_of Enumerator, @c1.each_section
end
def test_find_attribute_named
@@ -899,4 +892,3 @@ class TestRDocContext < XrefTestCase
end
end
-
diff --git a/test/rdoc/test_rdoc_markup_to_html_snippet.rb b/test/rdoc/test_rdoc_markup_to_html_snippet.rb
index 11bcd526be..d180f551c9 100644
--- a/test/rdoc/test_rdoc_markup_to_html_snippet.rb
+++ b/test/rdoc/test_rdoc_markup_to_html_snippet.rb
@@ -495,7 +495,7 @@ be guessed, raises an error if +name+ couldn't be guessed.
= \RDoc - Ruby Documentation System
* {RDoc Project Page}[https://github.com/rdoc/rdoc/]
-* {RDoc Documentation}[http://docs.seattlerb.org/rdoc]
+* {RDoc Documentation}[https://rdoc.github.io/rdoc]
* {RDoc Bug Tracker}[https://github.com/rdoc/rdoc/issues]
== DESCRIPTION:
@@ -709,4 +709,3 @@ This routine modifies its +comment+ parameter.
end
end
-
diff --git a/test/rdoc/test_rdoc_parser.rb b/test/rdoc/test_rdoc_parser.rb
index 732beb6629..b71d89b064 100644
--- a/test/rdoc/test_rdoc_parser.rb
+++ b/test/rdoc/test_rdoc_parser.rb
@@ -119,7 +119,7 @@ class TestRDocParser < RDoc::TestCase
end
io
end
- tf.close! if tf.respond_to? :close!
+ tf.close!
end
def test_class_for_modeline
diff --git a/test/rdoc/test_rdoc_rd_block_parser.rb b/test/rdoc/test_rdoc_rd_block_parser.rb
index 7afa9a03dd..18ec30db0f 100644
--- a/test/rdoc/test_rdoc_rd_block_parser.rb
+++ b/test/rdoc/test_rdoc_rd_block_parser.rb
@@ -165,7 +165,7 @@ class TestRDocRdBlockParser < RDoc::TestCase
assert_equal expected, parse(str)
io
end
- tf.close! if tf.respond_to? :close!
+ tf.close!
end
def test_parse_heading
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb
index 55096d394e..39f54555b5 100644
--- a/test/rdoc/test_rdoc_rdoc.rb
+++ b/test/rdoc/test_rdoc_rdoc.rb
@@ -133,7 +133,7 @@ class TestRDocRDoc < RDoc::TestCase
end
def test_normalized_file_list_non_file_directory
- dev = defined?(File::NULL) ? File::NULL : '/dev/stdin'
+ dev = File::NULL
skip "#{dev} is not a character special" unless
File.chardev? dev
@@ -261,7 +261,7 @@ class TestRDocRDoc < RDoc::TestCase
assert_equal Encoding::ISO_8859_1, top_level.absolute_name.encoding
io
end
- tf.close! if tf.respond_to? :close!
+ tf.close!
end
def test_parse_file_forbidden
@@ -290,7 +290,7 @@ class TestRDocRDoc < RDoc::TestCase
end
io
end
- tf.close! if tf.respond_to? :close!
+ tf.close!
end
def test_remove_unparseable
@@ -398,7 +398,7 @@ class TestRDocRDoc < RDoc::TestCase
e.message)
tempfile
end
- tf.close! if tf.respond_to? :close!
+ tf.close!
end
def test_setup_output_dir_exists_not_rdoc
diff --git a/test/rdoc/test_rdoc_rubygems_hook.rb b/test/rdoc/test_rdoc_rubygems_hook.rb
index 143d45ec66..ee16f3d95c 100644
--- a/test/rdoc/test_rdoc_rubygems_hook.rb
+++ b/test/rdoc/test_rdoc_rubygems_hook.rb
@@ -7,9 +7,6 @@ class TestRDocRubygemsHook < Gem::TestCase
def setup
super
- skip 'requires RubyGems 1.9+' unless
- Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.9')
-
@a = util_spec 'a', 2 do |s|
s.rdoc_options = %w[--main MyTitle]
s.extra_rdoc_files = %w[README]
@@ -134,7 +131,6 @@ class TestRDocRubygemsHook < Gem::TestCase
end
def test_generate_default_gem
- skip 'RubyGems 2 required' unless @a.respond_to? :default_gem?
@a.loaded_from =
File.join Gem::Specification.default_specifications_dir, 'a.gemspec'
diff --git a/test/rdoc/test_rdoc_store.rb b/test/rdoc/test_rdoc_store.rb
index 2c988aaea4..4082df71ea 100644
--- a/test/rdoc/test_rdoc_store.rb
+++ b/test/rdoc/test_rdoc_store.rb
@@ -3,7 +3,7 @@ require File.expand_path '../xref_test_case', __FILE__
class TestRDocStore < XrefTestCase
- OBJECT_ANCESTORS = defined?(::BasicObject) ? %w[BasicObject] : []
+ OBJECT_ANCESTORS = %w[BasicObject]
def setup
super
@@ -631,7 +631,7 @@ class TestRDocStore < XrefTestCase
:title => nil,
}
- expected[:ancestors]['Object'] = %w[BasicObject] if defined?(::BasicObject)
+ expected[:ancestors]['Object'] = %w[BasicObject]
open File.join(@tmpdir, 'cache.ri'), 'rb' do |io|
cache = Marshal.load io.read
@@ -699,7 +699,7 @@ class TestRDocStore < XrefTestCase
:title => 'title',
}
- expected[:ancestors]['Object'] = %w[BasicObject] if defined?(::BasicObject)
+ expected[:ancestors]['Object'] = %w[BasicObject]
open File.join(@tmpdir, 'cache.ri'), 'rb' do |io|
cache = Marshal.load io.read