From cdc527db342eda4c58b62c5dc2a14441a395df5d Mon Sep 17 00:00:00 2001 From: hsbt Date: Sat, 5 Nov 2016 09:18:10 +0000 Subject: * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0 Release note: https://github.com/rdoc/rdoc/blob/b825775647f62c5b525e9780a28ff2fbb1d5bf6f/History.rdoc#500--2016-11-05 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc.rb | 2 +- lib/rdoc/.document | 1 + lib/rdoc/context.rb | 3 +- lib/rdoc/generator.rb | 1 - lib/rdoc/generator/template/darkfish/_footer.rhtml | 2 +- lib/rdoc/markdown.rb | 3 +- lib/rdoc/markdown/literals.rb | 24 ++++------------ lib/rdoc/markup/pre_process.rb | 5 +--- lib/rdoc/markup/to_bs.rb | 2 -- lib/rdoc/options.rb | 13 --------- lib/rdoc/parser.rb | 25 +++++------------ lib/rdoc/rdoc.gemspec | 32 ++++++++++------------ lib/rdoc/rdoc.rb | 12 +++----- lib/rdoc/ri/driver.rb | 2 +- lib/rdoc/ruby_lex.rb | 6 +--- lib/rdoc/rubygems_hook.rb | 10 ++----- lib/rdoc/stats/normal.rb | 12 ++------ lib/rdoc/store.rb | 7 +---- lib/rdoc/test_case.rb | 2 +- 19 files changed, 45 insertions(+), 119 deletions(-) create mode 100644 lib/rdoc/.document (limited to 'lib') 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 @@ 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 -- cgit v1.2.3