1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merge rdoc-6.0.0.beta4 from upstream.

It version applied `frozen_string_literal: true`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2017-11-27 10:45:24 +00:00
parent 2d9f20e1cf
commit 5551871086
195 changed files with 1631 additions and 1258 deletions

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
$DEBUG_RDOC = nil
# :main: README.rdoc
@ -65,7 +65,7 @@ module RDoc
##
# RDoc version you are using
VERSION = '6.0.0.beta3'
VERSION = '6.0.0.beta4'
##
# Method visibilities

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Represent an alias, which is an old_name/new_name pair associated with a
# particular context

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# An anonymous class like:
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# AnyMethod is the base class for objects representing methods
@ -244,9 +244,9 @@ class RDoc::AnyMethod < RDoc::MethodAttr
if @block_params then
# If this method has explicit block parameters, remove any explicit
# &block
params.sub!(/,?\s*&\w+/, '')
params = params.sub(/,?\s*&\w+/, '')
else
params.sub!(/\&(\w+)/, '\1')
params = params.sub(/\&(\w+)/, '\1')
end
params = params.gsub(/\s+/, '').split(',').reject(&:empty?)
@ -265,7 +265,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
elsif @params then
params = @params.gsub(/\s*\#.*/, '')
params = params.tr("\n", " ").squeeze(" ")
params = params.tr_s("\n ", " ")
params = "(#{params})" unless params[0] == ?(
else
params = ''
@ -274,11 +274,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
if @block_params then
# If this method has explicit block parameters, remove any explicit
# &block
params.sub!(/,?\s*&\w+/, '')
params = params.sub(/,?\s*&\w+/, '')
block = @block_params.tr("\n", " ").squeeze(" ")
block = @block_params.tr_s("\n ", " ")
if block[0] == ?(
block.sub!(/^\(/, '').sub!(/\)/, '')
block = block.sub(/^\(/, '').sub(/\)/, '')
end
params << " { |#{block}| ... }"
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# An attribute created by \#attr, \#attr_reader, \#attr_writer or
# \#attr_accessor

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# ClassModule is the base class for objects representing either a class or a
# module.
@ -136,7 +136,9 @@ class RDoc::ClassModule < RDoc::Context
normalize_comment comment
end
if location.parser == RDoc::Parser::C
@comment_location.delete_if { |(_, l)| l == location }
end
@comment_location << [comment, location]

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Base class for the RDoc code tree.
#
@ -144,7 +144,7 @@ class RDoc::CodeObject
# HACK correct fix is to have #initialize create @comment
# with the correct encoding
if String === @comment and @comment.empty? then
@comment.force_encoding comment.encoding
@comment = RDoc::Encoding.change_encoding @comment, comment.encoding
end
@comment
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
# This file was used to load all the RDoc::CodeObject subclasses at once. Now
# autoload handles this.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A comment holds the text comment for a RDoc::CodeObject and provides a
# unified way of cleaning it up and parsing it into an RDoc::Markup::Document.
@ -45,7 +45,7 @@ class RDoc::Comment
def initialize text = nil, location = nil
@location = location
@text = text
@text = text.nil? ? nil : text.dup
@document = nil
@format = 'rdoc'
@ -114,11 +114,15 @@ class RDoc::Comment
method.call_seq = seq.chomp
elsif @text.sub!(/^\s*:?call-seq:(.*?)(^\s*$|\z)/m, '') then
else
regexp = /^\s*:?call-seq:(.*?)(^\s*$|\z)/m
if regexp =~ @text then
@text = @text.sub(regexp, '')
seq = $1
seq.gsub!(/^\s*/, '')
method.call_seq = seq
end
end
method
end
@ -133,8 +137,14 @@ class RDoc::Comment
##
# HACK dubious
def force_encoding encoding
@text.force_encoding encoding
def encode! encoding
# TODO: Remove this condition after Ruby 2.2 EOL
if RUBY_VERSION < '2.3.0'
@text = @text.force_encoding encoding
else
@text = String.new @text, encoding: encoding
end
self
end
##
@ -200,7 +210,7 @@ class RDoc::Comment
def remove_private
# Workaround for gsub encoding for Ruby 1.9.2 and earlier
empty = ''
empty.force_encoding @text.encoding
empty = RDoc::Encoding.change_encoding empty, @text.encoding
@text = @text.gsub(%r%^\s*([#*]?)--.*?^\s*(\1)\+\+\n?%m, empty)
@text = @text.sub(%r%^\s*[#*]?--.*%m, '')
@ -216,7 +226,7 @@ class RDoc::Comment
@text.nil? and @document
@document = nil
@text = text
@text = text.nil? ? nil : text.dup
end
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A constant

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'cgi'
##
@ -239,7 +239,7 @@ class RDoc::Context < RDoc::CodeObject
if known then
known.comment = attribute.comment if known.comment.empty?
elsif registered = @methods_hash[attribute.pretty_name << '='] and
elsif registered = @methods_hash[attribute.pretty_name + '='] and
RDoc::Attr === registered then
registered.rw = 'RW'
else
@ -249,7 +249,7 @@ class RDoc::Context < RDoc::CodeObject
end
if attribute.rw.index 'W' then
key = attribute.pretty_name << '='
key = attribute.pretty_name + '='
known = @methods_hash[key]
if known then

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A section of documentation like:
#
@ -43,7 +43,7 @@ class RDoc::Context::Section
@parent = parent
@title = title ? title.strip : title
@@sequence.succ!
@@sequence = @@sequence.succ
@sequence = @@sequence.dup
@comments = []

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# RDoc::CrossReference is a reusable way to create cross references for names.

View file

@ -1,5 +1,5 @@
# coding: US-ASCII
# frozen_string_literal: false
# frozen_string_literal: true
##
# This class is a wrapper around File IO and Encoding that helps RDoc load
@ -23,26 +23,26 @@ module RDoc::Encoding
utf8 = content.sub!(/\A\xef\xbb\xbf/, '')
RDoc::Encoding.set_encoding content
content = RDoc::Encoding.set_encoding content
begin
encoding ||= Encoding.default_external
orig_encoding = content.encoding
if not orig_encoding.ascii_compatible? then
content.encode! encoding
content = content.encode encoding
elsif utf8 then
content.force_encoding Encoding::UTF_8
content.encode! encoding
content = RDoc::Encoding.change_encoding content, Encoding::UTF_8
content = content.encode encoding
else
# assume the content is in our output encoding
content.force_encoding encoding
content = RDoc::Encoding.change_encoding content, encoding
end
unless content.valid_encoding? then
# revert and try to transcode
content.force_encoding orig_encoding
content.encode! encoding
content = RDoc::Encoding.change_encoding content, orig_encoding
content = content.encode encoding
end
unless content.valid_encoding? then
@ -52,9 +52,10 @@ module RDoc::Encoding
rescue Encoding::InvalidByteSequenceError,
Encoding::UndefinedConversionError => e
if force_transcode then
content.force_encoding orig_encoding
content.encode!(encoding,
:invalid => :replace, :undef => :replace,
content = RDoc::Encoding.change_encoding content, orig_encoding
content = content.encode(encoding,
:invalid => :replace,
:undef => :replace,
:replace => '?')
return content
else
@ -77,15 +78,17 @@ module RDoc::Encoding
first_line = $1
if first_line =~ /\A# +frozen[-_]string[-_]literal[=:].+$/i
string.sub! first_line, ''
string = string.sub first_line, ''
end
string
end
##
# Sets the encoding of +string+ based on the magic comment
def self.set_encoding string
remove_frozen_string_literal string
string = remove_frozen_string_literal string
string =~ /\A(?:#!.*\n)?(.*\n)/
@ -94,15 +97,34 @@ module RDoc::Encoding
name = case first_line
when /^<\?xml[^?]*encoding=(["'])(.*?)\1/ then $2
when /\b(?:en)?coding[=:]\s*([^\s;]+)/i then $1
else return
else return string
end
string.sub! first_line, ''
string = string.sub first_line, ''
remove_frozen_string_literal string
string = remove_frozen_string_literal string
enc = Encoding.find name
string.force_encoding enc if enc
string = RDoc::Encoding.change_encoding string, enc if enc
string
end
##
# Changes encoding based on +encoding+ without converting and returns new
# string
def self.change_encoding text, encoding
if text.kind_of? RDoc::Comment
text.encode! encoding
else
# TODO: Remove this condition after Ruby 2.2 EOL
if RUBY_VERSION < '2.3.0'
text.force_encoding encoding
else
String.new text, encoding: encoding
end
end
end
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Allows an ERB template to be rendered in the context (binding) of an
# existing ERB template evaluation.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'erb'
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A Module extension to a class with \#extend
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# RDoc uses generators to turn parsed source code in the form of an
# RDoc::CodeObject tree into some form of output. RDoc comes with the HTML

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
# -*- mode: ruby; ruby-indent-level: 2; tab-width: 2 -*-
require 'erb'
@ -313,12 +313,16 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
asset_rel_prefix = rel_prefix + @asset_rel_path
@title = @options.title
render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
rescue => e
error = RDoc::Error.new \
"error generating index.html: #{e.message} (#{e.class})"
@ -343,14 +347,19 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
svninfo = svninfo = get_svninfo(current)
asset_rel_prefix = rel_prefix + @asset_rel_path
svninfo = get_svninfo(current)
@title = "#{klass.type} #{klass.full_name} - #{@options.title}"
debug_msg " rendering #{out_file}"
render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here.local_variable_set(:svninfo, svninfo)
here
end
end
##
@ -416,8 +425,7 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
asset_rel_prefix = rel_prefix + @asset_rel_path
unless filepage_file then
if file.text? then
@ -434,7 +442,13 @@ class RDoc::Generator::Darkfish
@title += " - #{@options.title}"
template_file ||= filepage_file
render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here.local_variable_set(:current, current)
here
end
end
rescue => e
error =
@ -458,14 +472,19 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
# suppress 1.9.3 warning
current = current = file
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
current = file
asset_rel_prefix = rel_prefix + @asset_rel_path
@title = "#{file.page_name} - #{@options.title}"
debug_msg " rendering #{out_file}"
render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:current, current)
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
end
##
@ -483,12 +502,16 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = ''
asset_rel_prefix = ''
@title = 'Not Found'
render_template template_file do |io| binding end
render_template template_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
rescue => e
error = RDoc::Error.new \
"error generating servlet_not_found: #{e.message} (#{e.class})"
@ -540,12 +563,16 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
asset_rel_prefix = rel_prefix + @asset_rel_path
@title = "Table of Contents - #{@options.title}"
render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
rescue => e
error = RDoc::Error.new \
"error generating table_of_contents.html: #{e.message} (#{e.class})"

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'json'
begin
require 'zlib'
@ -161,7 +161,7 @@ class RDoc::Generator::JsonIndex
# Compress the search_index.js file using gzip
def generate_gzipped
return unless defined?(Zlib)
return if @options.dry_run or not defined?(Zlib)
debug_msg "Compressing generated JSON index"
out_dir = @base_dir + @options.op_dir

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Handle common RDoc::Markup tasks for various CodeObjects
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Generates a POT file.
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Extracts message from RDoc::Store

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Generates a PO format text
@ -29,8 +29,8 @@ class RDoc::Generator::POT::PO
def to_s
po = ''
sort_entries.each do |entry|
po << "\n" unless po.empty?
po << entry.to_s
po += "\n" unless po.empty?
po += entry.to_s
end
po
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A PO entry in PO
@ -40,11 +40,11 @@ class RDoc::Generator::POT::POEntry
def to_s
entry = ''
entry << format_translator_comment
entry << format_extracted_comment
entry << format_references
entry << format_flags
entry << <<-ENTRY
entry += format_translator_comment
entry += format_extracted_comment
entry += format_references
entry += format_flags
entry += <<-ENTRY
msgid #{format_message(@msgid)}
msgstr #{format_message(@msgstr)}
ENTRY
@ -75,9 +75,9 @@ msgstr #{format_message(@msgstr)}
formatted_comment = ''
comment.each_line do |line|
formatted_comment << "#{mark} #{line}"
formatted_comment += "#{mark} #{line}"
end
formatted_comment << "\n" unless formatted_comment.end_with?("\n")
formatted_comment += "\n" unless formatted_comment.end_with?("\n")
formatted_comment
end
@ -94,7 +94,7 @@ msgstr #{format_message(@msgstr)}
formatted_references = ''
@references.sort.each do |file, line|
formatted_references << "\#: #{file}:#{line}\n"
formatted_references += "\#: #{file}:#{line}\n"
end
formatted_references
end
@ -111,8 +111,8 @@ msgstr #{format_message(@msgstr)}
formatted_message = '""'
message.each_line do |line|
formatted_message << "\n"
formatted_message << "\"#{escape(line)}\""
formatted_message += "\n"
formatted_message += "\"#{escape(line)}\""
end
formatted_message
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Generates ri data files

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# GhostMethod represents a method referenced only by a comment

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# This module provides i18n related features.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A message container for a locale.
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# An i18n supported text.
#
@ -46,9 +46,9 @@ class RDoc::I18n::Text
parse do |part|
case part[:type]
when :paragraph
translated_text << locale.translate(part[:paragraph])
translated_text += locale.translate(part[:paragraph])
when :empty_line
translated_text << part[:line]
translated_text += part[:line]
else
raise "should not reach here: unexpected type: #{type}"
end
@ -69,14 +69,14 @@ class RDoc::I18n::Text
if paragraph.empty?
emit_empty_line_event(line, line_no, &block)
else
paragraph << line
paragraph += line
emit_paragraph_event(paragraph, paragraph_start_line, line_no,
&block)
paragraph = ''
end
else
paragraph_start_line = line_no if paragraph.empty?
paragraph << line
paragraph += line
end
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A Module included in a class with \#include
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
module RDoc
##

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# HTML entity name map for RDoc::Markdown

View file

@ -1,5 +1,4 @@
# coding: UTF-8
# frozen_string_literal: false
# :markup: markdown
##
@ -183,6 +182,7 @@ class RDoc::Markdown::Literals
return nil
end
if "".respond_to? :ord
def get_byte
if @pos >= @string_size
return nil
@ -192,6 +192,17 @@ class RDoc::Markdown::Literals
@pos += 1
s
end
else
def get_byte
if @pos >= @string_size
return nil
end
s = @string[@pos]
@pos += 1
s
end
end
def parse(rule=nil)
# We invoke the rules indirectly via apply

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# RDoc::Markup parses plain text documents and attempts to decompose them into
# their constituent parts. Some of these parts are high-level: paragraphs,

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
class RDoc::Markup
AttrChanger = Struct.new :turn_on, :turn_off # :nodoc:

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# An array of attributes which parallels the characters in a string.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Manages changes of attributes in a block of text
@ -246,7 +246,7 @@ class RDoc::Markup::AttributeManager
# Processes +str+ converting attributes, HTML and specials
def flow str
@str = str
@str = str.dup
mask_protected_sequences

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# We manage a set of attributes. Each attribute has a symbol name and a bit
# value.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# An empty line. This class is a singleton.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A quoted section which contains markup items.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A Document containing lists, headings, paragraphs, etc.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Base class for RDoc markup formatters
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'minitest/unit'
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A hard-break in the middle of a paragraph.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A heading with a level (1-6) and text

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A file included at generation time. Objects of this class are created by
# RDoc::RD for an extension-less include.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# An Indented Paragraph of text

View file

@ -1,2 +1,2 @@
# frozen_string_literal: false
# frozen_string_literal: true
warn "requiring rdoc/markup/inline is deprecated and will be removed in RDoc 4." if $-w

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A List is a homogeneous set of ListItems.
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# An item within a List that contains paragraphs, headings, etc.
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A Paragraph of text

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'strscan'
##
@ -249,7 +249,7 @@ class RDoc::Markup::Parser
min_indent = nil
generate_leading_spaces = true
line = ''
line = ''.dup
until @tokens.empty? do
type, data, column, = get
@ -257,7 +257,7 @@ class RDoc::Markup::Parser
if type == :NEWLINE then
line << data
verbatim << line
line = ''
line = ''.dup
generate_leading_spaces = true
next
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Handle common directives that can occur in a block of text:
#
@ -105,7 +105,7 @@ class RDoc::Markup::PreProcess
# regexp helper (square brackets for optional)
# $1 $2 $3 $4 $5
# [prefix][\]:directive:[spaces][param]newline
text.gsub!(/^([ \t]*(?:#|\/?\*)?[ \t]*)(\\?):(\w+):([ \t]*)(.+)?(\r?\n|$)/) do
text = text.gsub(/^([ \t]*(?:#|\/?\*)?[ \t]*)(\\?):(\w+):([ \t]*)(.+)?(\r?\n|$)/) do
# skip something like ':toto::'
next $& if $4.empty? and $5 and $5[0, 1] == ':'
@ -123,7 +123,11 @@ class RDoc::Markup::PreProcess
handle_directive $1, $3, $5, code_object, text.encoding, &block
end
comment = text unless comment
if comment then
comment.text = text
else
comment = text
end
self.class.post_processors.each do |handler|
handler.call comment, code_object
@ -150,7 +154,7 @@ class RDoc::Markup::PreProcess
case directive
when 'arg', 'args' then
return "#{prefix}:#{directive}: #{param}\n" unless code_object
return "#{prefix}:#{directive}: #{param}\n" unless code_object && code_object.kind_of?(RDoc::AnyMethod)
code_object.params = param
@ -212,7 +216,7 @@ class RDoc::Markup::PreProcess
when 'yield', 'yields' then
return blankline unless code_object
# remove parameter &block
code_object.params.sub!(/,?\s*&\w+/, '') if code_object.params
code_object.params = code_object.params.sub(/,?\s*&\w+/, '') if code_object.params
code_object.block_params = param

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A section of text that is added to the output document as-is

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A horizontal rule with a weight

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Hold details of a special sequence

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Test case for creating new plain-text RDoc::Markup formatters. See also
# RDoc::Markup::FormatterTestCase

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Outputs RDoc markup with vibrant ANSI color!

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Outputs RDoc markup with hot backspace action! You will probably need a
# pager to use this output format.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'cgi'
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Subclass of the RDoc::Markup::ToHtml class that supports looking up method
# names, classes, etc to create links. RDoc::CrossReference is used to

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Outputs RDoc markup as paragraphs with inline markup only.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Joins the parts of an RDoc::Markup::Paragraph into a single String.
#
@ -23,37 +23,11 @@ class RDoc::Markup::ToJoinedParagraph < RDoc::Markup::Formatter
# Converts the parts of +paragraph+ to a single entry.
def accept_paragraph paragraph
parts = []
string = false
paragraph.parts.each do |part|
if String === part then
if string then
string << part
else
parts << part
string = part
end
else
parts << part
string = false
end
end
parts = parts.map do |part|
if String === part then
part.rstrip
else
part
end
end
# TODO use Enumerable#chunk when Ruby 1.8 support is dropped
#parts = paragraph.parts.chunk do |part|
# String === part
#end.map do |string, chunk|
# string ? chunk.join.rstrip : chunk
#end.flatten
parts = paragraph.parts.chunk do |part|
String === part
end.map do |string, chunk|
string ? chunk.join.rstrip : chunk
end.flatten
paragraph.parts.replace parts
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'cgi'
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
# :markup: markdown
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Outputs RDoc markup as RDoc markup! (mostly)

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Extracts just the RDoc::Markup::Heading elements from a
# RDoc::Markup::Document to help build a table of contents

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# This Markup outputter is used for testing purposes.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Extracts sections of text enclosed in plus, tt or code. Used to discover
# undocumented parameters.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A section of verbatim text

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# MetaMethod represents a meta-programmed method

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Abstract class representing either a method or an attribute.
@ -188,7 +188,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
next if String === ancestor
next if parent == ancestor
other = ancestor.find_method_named('#' << name) ||
other = ancestor.find_method_named('#' + name) ||
ancestor.find_attribute_named(name)
return other if other

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A Mixin adds features from a module into another context. RDoc::Include and
# RDoc::Extend are both mixins.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A normal class, neither singleton nor anonymous
@ -47,9 +47,9 @@ class RDoc::NormalClass < RDoc::ClassModule
def to_s # :nodoc:
display = "#{self.class.name} #{self.full_name}"
if superclass
display << ' < ' << (superclass.is_a?(String) ? superclass : superclass.full_name)
display += ' < ' + (superclass.is_a?(String) ? superclass : superclass.full_name)
end
display << ' -> ' << is_alias_for.to_s if is_alias_for
display += ' -> ' + is_alias_for.to_s if is_alias_for
display
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A normal module, like NormalClass

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'optparse'
require 'pathname'
@ -624,16 +624,16 @@ Usage: #{opt.program_name} [options] [names...]
end
parsers.sort.each do |parser, regexp|
opt.banner << " - #{parser}: #{regexp.join ', '}\n"
opt.banner += " - #{parser}: #{regexp.join ', '}\n"
end
opt.banner << " - TomDoc: Only in ruby files\n"
opt.banner += " - TomDoc: Only in ruby files\n"
opt.banner << "\n The following options are deprecated:\n\n"
opt.banner += "\n The following options are deprecated:\n\n"
name_length = DEPRECATED.keys.sort_by { |k| k.length }.last.length
DEPRECATED.sort_by { |k,| k }.each do |name, reason|
opt.banner << " %*1$2$s %3$s\n" % [-name_length, name, reason]
opt.banner += " %*1$2$s %3$s\n" % [-name_length, name, reason]
end
opt.accept Template do |template|
@ -1087,7 +1087,7 @@ Usage: #{opt.program_name} [options] [names...]
unless quiet then
deprecated.each do |opt|
$stderr.puts 'option ' << opt << ' is deprecated: ' << DEPRECATED[opt]
$stderr.puts 'option ' + opt + ' is deprecated: ' + DEPRECATED[opt]
end
end

View file

@ -1,5 +1,5 @@
# -*- coding: us-ascii -*-
# frozen_string_literal: false
# frozen_string_literal: true
##
# A parser is simple a class that subclasses RDoc::Parser and implements #scan

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'tsort'
##
@ -865,8 +865,8 @@ class RDoc::Parser::C < RDoc::Parser
def handle_attr(var_name, attr_name, read, write)
rw = ''
rw << 'R' if '1' == read
rw << 'W' if '1' == write
rw += 'R' if '1' == read
rw += 'W' if '1' == write
class_name = @known_classes[var_name]
@ -982,8 +982,8 @@ class RDoc::Parser::C < RDoc::Parser
if new_definition.empty? then # Default to literal C definition
new_definition = definition
else
new_definition.gsub!("\:", ":")
new_definition.gsub!("\\", '\\')
new_definition = new_definition.gsub("\:", ":")
new_definition = new_definition.gsub("\\", '\\')
end
new_definition.sub!(/\A(\s+)/, '')
@ -1237,7 +1237,7 @@ class RDoc::Parser::C < RDoc::Parser
# when scanning for classes and methods
def remove_commented_out_lines
@content.gsub!(%r%//.*rb_define_%, '//')
@content = @content.gsub(%r%//.*rb_define_%, '//')
end
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'time'
##
@ -29,13 +29,13 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
if last =~ /\)\s*\z/ and continuation =~ /\A\(/ then
last.sub!(/\)\s*\z/, ',')
continuation.sub!(/\A\(/, '')
continuation = continuation.sub(/\A\(/, '')
end
if last =~ /\s\z/ then
last << continuation
else
last << ' ' << continuation
last << ' ' + continuation
end
end
@ -162,12 +162,12 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
entry_body = []
when /^(\t| {8})?\*\s*(.*)/ then # "\t* file.c (func): ..."
entry_body << $2
entry_body << $2.dup
when /^(\t| {8})?\s*(\(.*)/ then # "\t(func): ..."
entry = $2
if entry_body.last =~ /:/ then
entry_body << entry
entry_body << entry.dup
else
continue_entry_body entry_body, entry
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Parse a Markdown format file. The parsed RDoc::Markup::Document is attached
# as a file comment.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Parse a RD format file. The parsed RDoc::Markup::Document is attached as a
# file comment.

View file

@ -1,6 +1,9 @@
require 'ripper'
class RDoc::RipperStateLex
# TODO: Remove this constants after Ruby 2.4 EOL
RIPPER_HAS_LEX_STATE = Ripper::Filter.method_defined?(:state)
EXPR_NONE = 0
EXPR_BEG = 1
EXPR_END = 2
@ -283,8 +286,23 @@ class RDoc::RipperStateLex
@callback = block
parse
end
end unless RIPPER_HAS_LEX_STATE
class InnerStateLex < Ripper::Filter
def initialize(code)
super(code)
end
def on_default(event, tok, data)
@callback.call({ :line_no => lineno, :char_no => column, :kind => event, :text => tok, :state => state})
end
def each(&block)
@callback = block
parse
end
end if RIPPER_HAS_LEX_STATE
def get_squashed_tk
if @buf.empty?
tk = @inner_lex_enumerator.next
@ -297,10 +315,10 @@ class RDoc::RipperStateLex
when :on_tstring_beg then
tk = get_string_tk(tk)
when :on_backtick then
if (EXPR_FNAME & tk[:state]) != 0
@inner_lex.lex_state = EXPR_ARG
if (tk[:state] & (EXPR_FNAME | EXPR_ENDFN)) != 0
@inner_lex.lex_state = EXPR_ARG unless RIPPER_HAS_LEX_STATE
tk[:kind] = :on_ident
tk[:state] = @inner_lex.lex_state
tk[:state] = Ripper::Lexer.const_defined?(:State) ? Ripper::Lexer::State.new(EXPR_ARG) : EXPR_ARG
else
tk = get_string_tk(tk)
end
@ -310,7 +328,7 @@ class RDoc::RipperStateLex
tk = get_embdoc_tk(tk)
when :on_heredoc_beg then
@heredoc_queue << retrieve_heredoc_info(tk)
@inner_lex.lex_state = EXPR_END
@inner_lex.lex_state = EXPR_END unless RIPPER_HAS_LEX_STATE
when :on_nl, :on_ignored_nl, :on_comment, :on_heredoc_end then
unless @heredoc_queue.empty?
get_heredoc_tk(*@heredoc_queue.shift)
@ -540,10 +558,10 @@ class RDoc::RipperStateLex
private def get_op_tk(tk)
redefinable_operators = %w[! != !~ % & * ** + +@ - -@ / < << <= <=> == === =~ > >= >> [] []= ^ ` | ~]
if redefinable_operators.include?(tk[:text]) and EXPR_ARG == tk[:state] then
@inner_lex.lex_state = EXPR_ARG
if redefinable_operators.include?(tk[:text]) and tk[:state] == EXPR_ARG then
@inner_lex.lex_state = EXPR_ARG unless RIPPER_HAS_LEX_STATE
tk[:state] = Ripper::Lexer.const_defined?(:State) ? Ripper::Lexer::State.new(EXPR_ARG) : EXPR_ARG
tk[:kind] = :on_ident
tk[:state] = @inner_lex.lex_state
elsif tk[:text] =~ /^[-+]$/ then
tk_ahead = get_squashed_tk
case tk_ahead[:kind]

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# This file contains stuff stolen outright from:
#
@ -239,8 +239,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
def collect_first_comment
skip_tkspace
comment = ''
comment.force_encoding @encoding if @encoding
comment = ''.dup
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
first_line = true
first_comment_tk_kind = nil
@ -318,8 +318,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
##
# Looks for a true or false token. Returns false if TkFALSE or TkNIL are
# found.
# Looks for a true or false token.
def get_bool
skip_tkspace
@ -342,7 +341,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def get_class_or_module container, ignore_constants = false
skip_tkspace
name_t = get_tk
given_name = ''
given_name = ''.dup
# class ::A -> A is in the top level
if :on_op == name_t[:kind] and '::' == name_t[:text] then # bug
@ -379,7 +378,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
if prev_container == container and !ignore_constants
given_name = name_t[:text]
else
given_name << '::' << name_t[:text]
given_name << '::' + name_t[:text]
end
end
@ -574,27 +573,28 @@ class RDoc::Parser::Ruby < RDoc::Parser
#
# This routine modifies its +comment+ parameter.
def look_for_directives_in context, comment
@preprocess.handle comment, context do |directive, param|
def look_for_directives_in container, comment
@preprocess.handle comment, container do |directive, param|
case directive
when 'method', 'singleton-method',
'attr', 'attr_accessor', 'attr_reader', 'attr_writer' then
false # handled elsewhere
when 'section' then
context.set_current_section param, comment.dup
break unless container.kind_of?(RDoc::Context)
container.set_current_section param, comment.dup
comment.text = ''
break
end
end
remove_private_comments comment
comment.remove_private
end
##
# Adds useful info about the parser to +message+
def make_message message
prefix = "#{@file_name}:"
prefix = "#{@file_name}:".dup
tk = peek_tk
prefix << "#{tk[:line_no]}:#{tk[:char_no]}:" if tk
@ -913,7 +913,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
return unless body
value.replace body
con.value = body
record_location con
con.line = line_no
read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS
@ -928,7 +928,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_constant_body container, constant, is_array_or_hash # :nodoc:
nest = 0
rhs_name = ''
rhs_name = ''.dup
get_tkread
@ -944,7 +944,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
elsif (:on_kw == tk[:kind] && 'def' == tk[:text]) then
nest += 1
elsif (:on_kw == tk[:kind] && %w{do if unless case begin}.include?(tk[:text])) then
if (RDoc::RipperStateLex::EXPR_LABEL & tk[:state]) == 0
if (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) == 0
nest += 1
end
elsif [:on_rparen, :on_rbrace, :on_rbracket].include?(tk[:kind]) ||
@ -990,14 +990,13 @@ class RDoc::Parser::Ruby < RDoc::Parser
column = tk[:char_no]
line_no = tk[:line_no]
text = comment.text
singleton = !!text.sub!(/(^# +:?)(singleton-)(method:)/, '\1\3')
comment.text = comment.text.sub(/(^# +:?)(singleton-)(method:)/, '\1\3')
singleton = !!$~
co =
if text.sub!(/^# +:?method: *(\S*).*?\n/i, '') then
parse_comment_ghost container, text, $1, column, line_no, comment
elsif text.sub!(/# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i, '') then
if (comment.text = comment.text.sub(/^# +:?method: *(\S*).*?\n/i, '')) && !!$~ then
parse_comment_ghost container, comment.text, $1, column, line_no, comment
elsif (comment.text = comment.text.sub(/# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i, '')) && !!$~ then
parse_comment_attr container, $1, $3, comment
end
@ -1194,7 +1193,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
tmp = RDoc::CodeObject.new
read_documentation_modifiers tmp, RDoc::ATTR_MODIFIERS
if comment.text.sub!(/^# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i, '') then
regexp = /^# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i
if regexp =~ comment.text then
comment.text = comment.text.sub(regexp, '')
rw = case $1
when 'attr_reader' then 'R'
when 'attr_writer' then 'W'
@ -1227,7 +1228,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace false
singleton = !!comment.text.sub!(/(^# +:?)(singleton-)(method:)/, '\1\3')
comment.text = comment.text.sub(/(^# +:?)(singleton-)(method:)/, '\1\3')
singleton = !!$~
name = parse_meta_method_name comment, tk
@ -1290,6 +1292,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
token_listener meth do
meth.params = ''
look_for_directives_in meth, comment
comment.normalize
comment.extract_call_seq meth
@ -1336,6 +1339,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
return unless name
meth = RDoc::AnyMethod.new get_tkread, name
look_for_directives_in meth, comment
meth.singleton = single == SINGLE ? true : singleton
record_location meth
@ -1458,8 +1462,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
name_t2 = get_tk
if (:on_kw == name_t[:kind] && 'self' == name_t[:text]) || (:on_op == name_t[:kind] && '%' == name_t[:text]) then
# NOTE: work around '[' being consumed early and not being re-tokenized
# as a TkAREF
# NOTE: work around '[' being consumed early
if :on_lbracket == name_t2[:kind]
get_tk
name = '[]'
@ -1535,7 +1538,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
when :on_comment, :on_embdoc then
@read.pop
if :on_nl == end_token[:kind] and "\n" == tk[:text][-1] and
(!continue or (RDoc::RipperStateLex::EXPR_LABEL & tk[:state]) != 0) then
(!continue or (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) != 0) then
if method && method.block_params.nil? then
unget_tk tk
read_documentation_modifiers method, modifiers
@ -1642,7 +1645,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_statements(container, single = NORMAL, current_method = nil,
comment = new_comment(''))
raise 'no' unless RDoc::Comment === comment
comment.force_encoding @encoding if @encoding
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
nest = 1
save_visibility = container.visibility
@ -1685,12 +1688,12 @@ class RDoc::Parser::Ruby < RDoc::Parser
comment.empty?
comment = ''
comment.force_encoding @encoding if @encoding
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
end
while tk and (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) do
comment << tk[:text]
comment << "\n" unless "\n" == tk[:text].chars.to_a.last
comment += tk[:text]
comment += "\n" unless "\n" == tk[:text].chars.to_a.last
if tk[:text].size > 1 && "\n" == tk[:text].chars.to_a.last then
skip_tkspace false # leading spaces
@ -1740,7 +1743,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
when 'until', 'while' then
if (RDoc::RipperStateLex::EXPR_LABEL & tk[:state]) == 0
if (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) == 0
nest += 1
skip_optional_do_after_expression
end
@ -1756,7 +1759,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_optional_do_after_expression
when 'case', 'do', 'if', 'unless', 'begin' then
if (RDoc::RipperStateLex::EXPR_LABEL & tk[:state]) == 0
if (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) == 0
nest += 1
end
@ -1809,7 +1812,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
unless keep_comment then
comment = new_comment ''
comment.force_encoding @encoding if @encoding
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
container.params = nil
container.block_params = nil
end
@ -2053,15 +2056,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
container.record_location @top_level
end
##
# Removes private comments from +comment+
#--
# TODO remove
def remove_private_comments comment
comment.remove_private
end
##
# Scans this Ruby file for Ruby constructs

View file

@ -1,7 +1,6 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Collection of methods for writing parsers against RDoc::RubyLex and
# RDoc::RubyToken
# Collection of methods for writing parsers
module RDoc::Parser::RubyTools

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Parse a non-source file. We basically take the whole thing as one big
# comment.
@ -19,7 +19,7 @@ class RDoc::Parser::Simple < RDoc::Parser
preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
preprocess.handle @content, @top_level
@content = preprocess.handle @content, @top_level
end
##
@ -52,7 +52,7 @@ class RDoc::Parser::Simple < RDoc::Parser
def remove_private_comment comment
# Workaround for gsub encoding for Ruby 1.9.2 and earlier
empty = ''
empty.force_encoding comment.encoding
empty = RDoc::Encoding.change_encoding empty, comment.encoding
comment = comment.gsub(%r%^--\n.*?^\+\+\n?%m, empty)
comment.sub(%r%^--\n.*%m, empty)

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Indicates this parser is text and doesn't contain code constructs.
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# RDoc::RD implements the RD format from the rdtool gem.
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# Inline keeps track of markup and labels to create proper links.
@ -50,11 +50,11 @@ class RDoc::RD::Inline
def append more
case more
when String then
@reference << more
@rdoc << more
@reference += more
@rdoc += more
when RDoc::RD::Inline then
@reference << more.reference
@rdoc << more.rdoc
@reference += more.reference
@rdoc += more.rdoc
else
raise "unknown thingy #{more}"
end

View file

@ -412,9 +412,9 @@ racc_action_default = [
racc_goto_table = [
126, 44, 125, 52, 144, 144, 160, 93, 97, 43,
166, 82, 144, 40, 41, 39, 138, 146, 169, 90,
166, 82, 144, 41, 40, 39, 138, 146, 169, 90,
36, 52, 44, 1, 52, 129, 169, 94, 59, 83,
123, 30, 151, 92, 120, 121, 31, 32, 33, 34,
123, 30, 151, 92, 121, 120, 31, 32, 33, 34,
35, 170, 58, 166, 167, 147, 170, 166, 37, nil,
150, nil, 166, 159, 4, 166, 4, nil, nil, nil,
nil, 155, nil, 156, 160, nil, nil, 4, 4, 4,
@ -430,9 +430,9 @@ racc_goto_table = [
racc_goto_check = [
22, 24, 21, 34, 36, 36, 37, 18, 16, 23,
35, 41, 36, 19, 20, 17, 25, 25, 28, 14,
35, 41, 36, 20, 19, 17, 25, 25, 28, 14,
13, 34, 24, 1, 34, 24, 28, 23, 38, 39,
23, 3, 42, 17, 19, 20, 1, 1, 1, 1,
23, 3, 42, 17, 20, 19, 1, 1, 1, 1,
1, 33, 1, 35, 29, 32, 33, 35, 15, nil,
41, nil, 35, 22, 4, 35, 4, nil, nil, nil,
nil, 16, nil, 18, 37, nil, nil, 4, 4, 4,
@ -448,8 +448,8 @@ racc_goto_check = [
racc_goto_pointer = [
nil, 23, nil, 29, 54, 74, 109, 117, 127, nil,
nil, 135, nil, 2, -17, 30, -30, -3, -29, -5,
-4, -40, -42, -9, -17, -28, nil, nil, -120, -83,
nil, 135, nil, 2, -17, 30, -30, -3, -29, -4,
-5, -40, -42, -9, -17, -28, nil, nil, -120, -83,
nil, nil, -7, -101, -15, -116, -40, -91, 8, 2,
nil, -9, -29 ]

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'rdoc'
require 'find'
@ -521,6 +521,10 @@ The internal error was:
# by the RDoc options
def generate
if @options.dry_run then
# do nothing
@generator.generate
else
Dir.chdir @options.op_dir do
unless @options.quiet then
$stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..."
@ -530,6 +534,7 @@ The internal error was:
update_output_dir '.', @start_time, @last_modified
end
end
end
##
# Removes a siginfo handler and replaces the previous

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A file loaded by \#require

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'rdoc'
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'abbrev'
require 'optparse'

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# For RubyGems backwards compatibility

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'rdoc/ri'
##

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
module RDoc::RI
Store = RDoc::Store # :nodoc:

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
gem 'rdoc'
rescue Gem::LoadError

Some files were not shown because too many files have changed in this diff Show more