rdoc 6.0.0.beta3 → 6.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/Rakefile +5 -2
- data/lib/rdoc.rb +2 -3
- data/lib/rdoc/alias.rb +1 -1
- data/lib/rdoc/anon_class.rb +1 -1
- data/lib/rdoc/any_method.rb +7 -7
- data/lib/rdoc/attr.rb +1 -1
- data/lib/rdoc/class_module.rb +4 -2
- data/lib/rdoc/code_object.rb +2 -2
- data/lib/rdoc/code_objects.rb +1 -1
- data/lib/rdoc/comment.rb +20 -10
- data/lib/rdoc/constant.rb +1 -1
- data/lib/rdoc/context.rb +3 -3
- data/lib/rdoc/context/section.rb +2 -2
- data/lib/rdoc/cross_reference.rb +1 -1
- data/lib/rdoc/encoding.rb +40 -18
- data/lib/rdoc/erb_partial.rb +1 -1
- data/lib/rdoc/erbio.rb +1 -1
- data/lib/rdoc/extend.rb +1 -1
- data/lib/rdoc/generator.rb +1 -1
- data/lib/rdoc/generator/darkfish.rb +48 -21
- data/lib/rdoc/generator/json_index.rb +2 -2
- data/lib/rdoc/generator/markup.rb +1 -1
- data/lib/rdoc/generator/pot.rb +1 -1
- data/lib/rdoc/generator/pot/message_extractor.rb +1 -1
- data/lib/rdoc/generator/pot/po.rb +3 -3
- data/lib/rdoc/generator/pot/po_entry.rb +11 -11
- data/lib/rdoc/generator/ri.rb +1 -1
- data/lib/rdoc/ghost_method.rb +1 -1
- data/lib/rdoc/i18n.rb +1 -1
- data/lib/rdoc/i18n/locale.rb +1 -1
- data/lib/rdoc/i18n/text.rb +5 -5
- data/lib/rdoc/include.rb +1 -1
- data/lib/rdoc/known_classes.rb +1 -1
- data/lib/rdoc/markdown.kpeg +71 -41
- data/lib/rdoc/markdown/entities.rb +1 -1
- data/lib/rdoc/markdown/literals.kpeg +1 -0
- data/lib/rdoc/markdown/literals.rb +18 -7
- data/lib/rdoc/markup.rb +1 -1
- data/lib/rdoc/markup/attr_changer.rb +1 -1
- data/lib/rdoc/markup/attr_span.rb +1 -1
- data/lib/rdoc/markup/attribute_manager.rb +2 -2
- data/lib/rdoc/markup/attributes.rb +1 -1
- data/lib/rdoc/markup/blank_line.rb +1 -1
- data/lib/rdoc/markup/block_quote.rb +1 -1
- data/lib/rdoc/markup/document.rb +1 -1
- data/lib/rdoc/markup/formatter.rb +1 -1
- data/lib/rdoc/markup/formatter_test_case.rb +1 -1
- data/lib/rdoc/markup/hard_break.rb +1 -1
- data/lib/rdoc/markup/heading.rb +1 -1
- data/lib/rdoc/markup/include.rb +1 -1
- data/lib/rdoc/markup/indented_paragraph.rb +1 -1
- data/lib/rdoc/markup/inline.rb +1 -1
- data/lib/rdoc/markup/list.rb +1 -1
- data/lib/rdoc/markup/list_item.rb +1 -1
- data/lib/rdoc/markup/paragraph.rb +1 -1
- data/lib/rdoc/markup/parser.rb +3 -3
- data/lib/rdoc/markup/pre_process.rb +9 -5
- data/lib/rdoc/markup/raw.rb +1 -1
- data/lib/rdoc/markup/rule.rb +1 -1
- data/lib/rdoc/markup/special.rb +1 -1
- data/lib/rdoc/markup/text_formatter_test_case.rb +1 -1
- data/lib/rdoc/markup/to_ansi.rb +1 -1
- data/lib/rdoc/markup/to_bs.rb +1 -1
- data/lib/rdoc/markup/to_html.rb +1 -1
- data/lib/rdoc/markup/to_html_crossref.rb +1 -1
- data/lib/rdoc/markup/to_html_snippet.rb +1 -1
- data/lib/rdoc/markup/to_joined_paragraph.rb +6 -32
- data/lib/rdoc/markup/to_label.rb +1 -1
- data/lib/rdoc/markup/to_markdown.rb +1 -1
- data/lib/rdoc/markup/to_rdoc.rb +1 -1
- data/lib/rdoc/markup/to_table_of_contents.rb +1 -1
- data/lib/rdoc/markup/to_test.rb +1 -1
- data/lib/rdoc/markup/to_tt_only.rb +1 -1
- data/lib/rdoc/markup/verbatim.rb +1 -1
- data/lib/rdoc/meta_method.rb +1 -1
- data/lib/rdoc/method_attr.rb +2 -2
- data/lib/rdoc/mixin.rb +1 -1
- data/lib/rdoc/normal_class.rb +3 -3
- data/lib/rdoc/normal_module.rb +1 -1
- data/lib/rdoc/options.rb +6 -6
- data/lib/rdoc/parser.rb +1 -1
- data/lib/rdoc/parser/c.rb +6 -6
- data/lib/rdoc/parser/changelog.rb +5 -5
- data/lib/rdoc/parser/markdown.rb +1 -1
- data/lib/rdoc/parser/rd.rb +1 -1
- data/lib/rdoc/parser/ripper_state_lex.rb +26 -8
- data/lib/rdoc/parser/ruby.rb +36 -42
- data/lib/rdoc/parser/ruby_tools.rb +2 -3
- data/lib/rdoc/parser/simple.rb +3 -3
- data/lib/rdoc/parser/text.rb +1 -1
- data/lib/rdoc/rd.rb +1 -1
- data/lib/rdoc/rd/block_parser.ry +2 -2
- data/lib/rdoc/rd/inline.rb +5 -5
- data/lib/rdoc/rd/inline_parser.ry +1 -1
- data/lib/rdoc/rdoc.rb +12 -7
- data/lib/rdoc/require.rb +1 -1
- data/lib/rdoc/ri.rb +1 -1
- data/lib/rdoc/ri/driver.rb +1 -1
- data/lib/rdoc/ri/formatter.rb +1 -1
- data/lib/rdoc/ri/paths.rb +1 -1
- data/lib/rdoc/ri/store.rb +1 -1
- data/lib/rdoc/ri/task.rb +1 -1
- data/lib/rdoc/rubygems_hook.rb +1 -1
- data/lib/rdoc/servlet.rb +2 -2
- data/lib/rdoc/single_class.rb +1 -1
- data/lib/rdoc/stats.rb +1 -1
- data/lib/rdoc/stats/normal.rb +2 -2
- data/lib/rdoc/stats/quiet.rb +1 -1
- data/lib/rdoc/stats/verbose.rb +1 -1
- data/lib/rdoc/store.rb +1 -1
- data/lib/rdoc/task.rb +1 -1
- data/lib/rdoc/test_case.rb +3 -4
- data/lib/rdoc/text.rb +7 -7
- data/lib/rdoc/token_stream.rb +15 -7
- data/lib/rdoc/tom_doc.rb +2 -2
- data/lib/rdoc/top_level.rb +1 -1
- data/rdoc.gemspec +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 342dd946b79ae94f39a4d57825de50df2faa0115c34ce84bf2db00b6afa03429
|
4
|
+
data.tar.gz: e6ca1cfa9be24f43cf9df81b206d5e035e817e36a6841158ef583ac93175047b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ffbc7917d2f6d11e3a3f8c6d5a98e5ff774afdc499caa0ca98c2ecb62e2008eda64b8478dcbf67e8fa5de5e8bf51ba766354455db7f8fef1e4e5d42822a63dd
|
7
|
+
data.tar.gz: 39552e0dd1cad025fbcce9cf1cf7220e74f29dd8f74e67f84a6f468ed8f9121e97169e4047e72b03639fc9937ace4b6e2d5652dcfe9ec1bfd9a1c299d60c34a5
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -63,6 +63,11 @@ parsed_files = PARSER_FILES.map do |parser_file|
|
|
63
63
|
racc = Gem.bin_path 'racc', 'racc'
|
64
64
|
rb_file = parser_file.gsub(/\.ry\z/, ".rb")
|
65
65
|
ruby "#{racc} -l -o #{rb_file} #{parser_file}"
|
66
|
+
open(rb_file, 'r+') do |f|
|
67
|
+
newtext = "# frozen_string_literal: true\n#{f.read}"
|
68
|
+
f.rewind
|
69
|
+
f.write newtext
|
70
|
+
end
|
66
71
|
elsif parser_file =~ /\.kpeg\z/ # need kpeg
|
67
72
|
kpeg = Gem.bin_path 'kpeg', 'kpeg'
|
68
73
|
rb_file = parser_file.gsub(/\.kpeg\z/, ".rb")
|
@@ -104,8 +109,6 @@ end
|
|
104
109
|
|
105
110
|
desc "Diffs Ruby HEAD with the currently checked-out copy of RDoc."
|
106
111
|
task :diff_ruby do
|
107
|
-
options = "-urpN --exclude '*svn*' --exclude '*swp' --exclude '*rbc'"
|
108
|
-
|
109
112
|
sh "diff #{diff_options} bin/rdoc #{ruby_dir}/bin/rdoc; true"
|
110
113
|
sh "diff #{diff_options} bin/ri #{ruby_dir}/bin/ri; true"
|
111
114
|
sh "diff #{diff_options} lib/rdoc.rb #{ruby_dir}/lib/rdoc.rb; true"
|
data/lib/rdoc.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
$DEBUG_RDOC = nil
|
3
3
|
|
4
4
|
# :main: README.rdoc
|
@@ -65,7 +65,7 @@ module RDoc
|
|
65
65
|
##
|
66
66
|
# RDoc version you are using
|
67
67
|
|
68
|
-
VERSION = '6.0.0.
|
68
|
+
VERSION = '6.0.0.beta4'
|
69
69
|
|
70
70
|
##
|
71
71
|
# Method visibilities
|
@@ -149,7 +149,6 @@ module RDoc
|
|
149
149
|
autoload :KNOWN_CLASSES, 'rdoc/known_classes'
|
150
150
|
|
151
151
|
autoload :RipperStateLex, 'rdoc/parser/ripper_state_lex'
|
152
|
-
autoload :RubyToken, 'rdoc/ruby_token'
|
153
152
|
autoload :TokenStream, 'rdoc/token_stream'
|
154
153
|
|
155
154
|
autoload :Comment, 'rdoc/comment'
|
data/lib/rdoc/alias.rb
CHANGED
data/lib/rdoc/anon_class.rb
CHANGED
data/lib/rdoc/any_method.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
##
|
3
3
|
# AnyMethod is the base class for objects representing methods
|
4
4
|
|
@@ -244,9 +244,9 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
244
244
|
if @block_params then
|
245
245
|
# If this method has explicit block parameters, remove any explicit
|
246
246
|
# &block
|
247
|
-
params.sub
|
247
|
+
params = params.sub(/,?\s*&\w+/, '')
|
248
248
|
else
|
249
|
-
params.sub
|
249
|
+
params = params.sub(/\&(\w+)/, '\1')
|
250
250
|
end
|
251
251
|
|
252
252
|
params = params.gsub(/\s+/, '').split(',').reject(&:empty?)
|
@@ -265,7 +265,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
265
265
|
params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
|
266
266
|
elsif @params then
|
267
267
|
params = @params.gsub(/\s*\#.*/, '')
|
268
|
-
params = params.
|
268
|
+
params = params.tr_s("\n ", " ")
|
269
269
|
params = "(#{params})" unless params[0] == ?(
|
270
270
|
else
|
271
271
|
params = ''
|
@@ -274,11 +274,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
274
274
|
if @block_params then
|
275
275
|
# If this method has explicit block parameters, remove any explicit
|
276
276
|
# &block
|
277
|
-
params.sub
|
277
|
+
params = params.sub(/,?\s*&\w+/, '')
|
278
278
|
|
279
|
-
block = @block_params.
|
279
|
+
block = @block_params.tr_s("\n ", " ")
|
280
280
|
if block[0] == ?(
|
281
|
-
block.sub
|
281
|
+
block = block.sub(/^\(/, '').sub(/\)/, '')
|
282
282
|
end
|
283
283
|
params << " { |#{block}| ... }"
|
284
284
|
end
|
data/lib/rdoc/attr.rb
CHANGED
data/lib/rdoc/class_module.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
##
|
3
3
|
# ClassModule is the base class for objects representing either a class or a
|
4
4
|
# module.
|
@@ -136,7 +136,9 @@ class RDoc::ClassModule < RDoc::Context
|
|
136
136
|
normalize_comment comment
|
137
137
|
end
|
138
138
|
|
139
|
-
|
139
|
+
if location.parser == RDoc::Parser::C
|
140
|
+
@comment_location.delete_if { |(_, l)| l == location }
|
141
|
+
end
|
140
142
|
|
141
143
|
@comment_location << [comment, location]
|
142
144
|
|
data/lib/rdoc/code_object.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
##
|
3
3
|
# Base class for the RDoc code tree.
|
4
4
|
#
|
@@ -144,7 +144,7 @@ class RDoc::CodeObject
|
|
144
144
|
# HACK correct fix is to have #initialize create @comment
|
145
145
|
# with the correct encoding
|
146
146
|
if String === @comment and @comment.empty? then
|
147
|
-
@comment.
|
147
|
+
@comment = RDoc::Encoding.change_encoding @comment, comment.encoding
|
148
148
|
end
|
149
149
|
@comment
|
150
150
|
end
|
data/lib/rdoc/code_objects.rb
CHANGED
data/lib/rdoc/comment.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
##
|
3
3
|
# A comment holds the text comment for a RDoc::CodeObject and provides a
|
4
4
|
# unified way of cleaning it up and parsing it into an RDoc::Markup::Document.
|
@@ -45,7 +45,7 @@ class RDoc::Comment
|
|
45
45
|
|
46
46
|
def initialize text = nil, location = nil
|
47
47
|
@location = location
|
48
|
-
@text = text
|
48
|
+
@text = text.nil? ? nil : text.dup
|
49
49
|
|
50
50
|
@document = nil
|
51
51
|
@format = 'rdoc'
|
@@ -114,10 +114,14 @@ class RDoc::Comment
|
|
114
114
|
|
115
115
|
method.call_seq = seq.chomp
|
116
116
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
117
|
+
else
|
118
|
+
regexp = /^\s*:?call-seq:(.*?)(^\s*$|\z)/m
|
119
|
+
if regexp =~ @text then
|
120
|
+
@text = @text.sub(regexp, '')
|
121
|
+
seq = $1
|
122
|
+
seq.gsub!(/^\s*/, '')
|
123
|
+
method.call_seq = seq
|
124
|
+
end
|
121
125
|
end
|
122
126
|
|
123
127
|
method
|
@@ -133,8 +137,14 @@ class RDoc::Comment
|
|
133
137
|
##
|
134
138
|
# HACK dubious
|
135
139
|
|
136
|
-
def
|
137
|
-
|
140
|
+
def encode! encoding
|
141
|
+
# TODO: Remove this condition after Ruby 2.2 EOL
|
142
|
+
if RUBY_VERSION < '2.3.0'
|
143
|
+
@text = @text.force_encoding encoding
|
144
|
+
else
|
145
|
+
@text = String.new @text, encoding: encoding
|
146
|
+
end
|
147
|
+
self
|
138
148
|
end
|
139
149
|
|
140
150
|
##
|
@@ -200,7 +210,7 @@ class RDoc::Comment
|
|
200
210
|
def remove_private
|
201
211
|
# Workaround for gsub encoding for Ruby 1.9.2 and earlier
|
202
212
|
empty = ''
|
203
|
-
empty.
|
213
|
+
empty = RDoc::Encoding.change_encoding empty, @text.encoding
|
204
214
|
|
205
215
|
@text = @text.gsub(%r%^\s*([#*]?)--.*?^\s*(\1)\+\+\n?%m, empty)
|
206
216
|
@text = @text.sub(%r%^\s*[#*]?--.*%m, '')
|
@@ -216,7 +226,7 @@ class RDoc::Comment
|
|
216
226
|
@text.nil? and @document
|
217
227
|
|
218
228
|
@document = nil
|
219
|
-
@text = text
|
229
|
+
@text = text.nil? ? nil : text.dup
|
220
230
|
end
|
221
231
|
|
222
232
|
##
|
data/lib/rdoc/constant.rb
CHANGED
data/lib/rdoc/context.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
require 'cgi'
|
3
3
|
|
4
4
|
##
|
@@ -239,7 +239,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
239
239
|
|
240
240
|
if known then
|
241
241
|
known.comment = attribute.comment if known.comment.empty?
|
242
|
-
elsif registered = @methods_hash[attribute.pretty_name
|
242
|
+
elsif registered = @methods_hash[attribute.pretty_name + '='] and
|
243
243
|
RDoc::Attr === registered then
|
244
244
|
registered.rw = 'RW'
|
245
245
|
else
|
@@ -249,7 +249,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
249
249
|
end
|
250
250
|
|
251
251
|
if attribute.rw.index 'W' then
|
252
|
-
key = attribute.pretty_name
|
252
|
+
key = attribute.pretty_name + '='
|
253
253
|
known = @methods_hash[key]
|
254
254
|
|
255
255
|
if known then
|
data/lib/rdoc/context/section.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
##
|
3
3
|
# A section of documentation like:
|
4
4
|
#
|
@@ -43,7 +43,7 @@ class RDoc::Context::Section
|
|
43
43
|
@parent = parent
|
44
44
|
@title = title ? title.strip : title
|
45
45
|
|
46
|
-
@@sequence.succ
|
46
|
+
@@sequence = @@sequence.succ
|
47
47
|
@sequence = @@sequence.dup
|
48
48
|
|
49
49
|
@comments = []
|
data/lib/rdoc/cross_reference.rb
CHANGED
data/lib/rdoc/encoding.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# coding: US-ASCII
|
2
|
-
# frozen_string_literal:
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
4
|
##
|
5
5
|
# This class is a wrapper around File IO and Encoding that helps RDoc load
|
@@ -23,26 +23,26 @@ module RDoc::Encoding
|
|
23
23
|
|
24
24
|
utf8 = content.sub!(/\A\xef\xbb\xbf/, '')
|
25
25
|
|
26
|
-
RDoc::Encoding.set_encoding content
|
26
|
+
content = RDoc::Encoding.set_encoding content
|
27
27
|
|
28
28
|
begin
|
29
29
|
encoding ||= Encoding.default_external
|
30
30
|
orig_encoding = content.encoding
|
31
31
|
|
32
32
|
if not orig_encoding.ascii_compatible? then
|
33
|
-
content.encode
|
33
|
+
content = content.encode encoding
|
34
34
|
elsif utf8 then
|
35
|
-
content.
|
36
|
-
content.encode
|
35
|
+
content = RDoc::Encoding.change_encoding content, Encoding::UTF_8
|
36
|
+
content = content.encode encoding
|
37
37
|
else
|
38
38
|
# assume the content is in our output encoding
|
39
|
-
content.
|
39
|
+
content = RDoc::Encoding.change_encoding content, encoding
|
40
40
|
end
|
41
41
|
|
42
42
|
unless content.valid_encoding? then
|
43
43
|
# revert and try to transcode
|
44
|
-
content.
|
45
|
-
content.encode
|
44
|
+
content = RDoc::Encoding.change_encoding content, orig_encoding
|
45
|
+
content = content.encode encoding
|
46
46
|
end
|
47
47
|
|
48
48
|
unless content.valid_encoding? then
|
@@ -52,10 +52,11 @@ module RDoc::Encoding
|
|
52
52
|
rescue Encoding::InvalidByteSequenceError,
|
53
53
|
Encoding::UndefinedConversionError => e
|
54
54
|
if force_transcode then
|
55
|
-
content.
|
56
|
-
content.encode
|
57
|
-
|
58
|
-
|
55
|
+
content = RDoc::Encoding.change_encoding content, orig_encoding
|
56
|
+
content = content.encode(encoding,
|
57
|
+
:invalid => :replace,
|
58
|
+
:undef => :replace,
|
59
|
+
:replace => '?')
|
59
60
|
return content
|
60
61
|
else
|
61
62
|
warn "unable to convert #{e.message} for #{filename}, skipping"
|
@@ -77,15 +78,17 @@ module RDoc::Encoding
|
|
77
78
|
first_line = $1
|
78
79
|
|
79
80
|
if first_line =~ /\A# +frozen[-_]string[-_]literal[=:].+$/i
|
80
|
-
string.sub
|
81
|
+
string = string.sub first_line, ''
|
81
82
|
end
|
83
|
+
|
84
|
+
string
|
82
85
|
end
|
83
86
|
|
84
87
|
##
|
85
88
|
# Sets the encoding of +string+ based on the magic comment
|
86
89
|
|
87
90
|
def self.set_encoding string
|
88
|
-
remove_frozen_string_literal string
|
91
|
+
string = remove_frozen_string_literal string
|
89
92
|
|
90
93
|
string =~ /\A(?:#!.*\n)?(.*\n)/
|
91
94
|
|
@@ -94,15 +97,34 @@ module RDoc::Encoding
|
|
94
97
|
name = case first_line
|
95
98
|
when /^<\?xml[^?]*encoding=(["'])(.*?)\1/ then $2
|
96
99
|
when /\b(?:en)?coding[=:]\s*([^\s;]+)/i then $1
|
97
|
-
else return
|
100
|
+
else return string
|
98
101
|
end
|
99
102
|
|
100
|
-
string.sub
|
103
|
+
string = string.sub first_line, ''
|
101
104
|
|
102
|
-
remove_frozen_string_literal string
|
105
|
+
string = remove_frozen_string_literal string
|
103
106
|
|
104
107
|
enc = Encoding.find name
|
105
|
-
string.
|
108
|
+
string = RDoc::Encoding.change_encoding string, enc if enc
|
109
|
+
|
110
|
+
string
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Changes encoding based on +encoding+ without converting and returns new
|
115
|
+
# string
|
116
|
+
|
117
|
+
def self.change_encoding text, encoding
|
118
|
+
if text.kind_of? RDoc::Comment
|
119
|
+
text.encode! encoding
|
120
|
+
else
|
121
|
+
# TODO: Remove this condition after Ruby 2.2 EOL
|
122
|
+
if RUBY_VERSION < '2.3.0'
|
123
|
+
text.force_encoding encoding
|
124
|
+
else
|
125
|
+
String.new text, encoding: encoding
|
126
|
+
end
|
127
|
+
end
|
106
128
|
end
|
107
129
|
|
108
130
|
end
|
data/lib/rdoc/erb_partial.rb
CHANGED
data/lib/rdoc/erbio.rb
CHANGED
data/lib/rdoc/extend.rb
CHANGED
data/lib/rdoc/generator.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
# -*- mode: ruby; ruby-indent-level: 2; tab-width: 2 -*-
|
3
3
|
|
4
4
|
require 'erb'
|
@@ -313,12 +313,16 @@ class RDoc::Generator::Darkfish
|
|
313
313
|
search_index_rel_prefix = rel_prefix
|
314
314
|
search_index_rel_prefix += @asset_rel_path if @file_output
|
315
315
|
|
316
|
-
|
317
|
-
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
|
316
|
+
asset_rel_prefix = rel_prefix + @asset_rel_path
|
318
317
|
|
319
318
|
@title = @options.title
|
320
319
|
|
321
|
-
render_template template_file, out_file do |io|
|
320
|
+
render_template template_file, out_file do |io|
|
321
|
+
here = binding
|
322
|
+
# suppress 1.9.3 warning
|
323
|
+
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
|
324
|
+
here
|
325
|
+
end
|
322
326
|
rescue => e
|
323
327
|
error = RDoc::Error.new \
|
324
328
|
"error generating index.html: #{e.message} (#{e.class})"
|
@@ -343,14 +347,19 @@ class RDoc::Generator::Darkfish
|
|
343
347
|
search_index_rel_prefix = rel_prefix
|
344
348
|
search_index_rel_prefix += @asset_rel_path if @file_output
|
345
349
|
|
346
|
-
|
347
|
-
|
348
|
-
svninfo = svninfo = get_svninfo(current)
|
350
|
+
asset_rel_prefix = rel_prefix + @asset_rel_path
|
351
|
+
svninfo = get_svninfo(current)
|
349
352
|
|
350
353
|
@title = "#{klass.type} #{klass.full_name} - #{@options.title}"
|
351
354
|
|
352
355
|
debug_msg " rendering #{out_file}"
|
353
|
-
render_template template_file, out_file do |io|
|
356
|
+
render_template template_file, out_file do |io|
|
357
|
+
here = binding
|
358
|
+
# suppress 1.9.3 warning
|
359
|
+
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
|
360
|
+
here.local_variable_set(:svninfo, svninfo)
|
361
|
+
here
|
362
|
+
end
|
354
363
|
end
|
355
364
|
|
356
365
|
##
|
@@ -416,8 +425,7 @@ class RDoc::Generator::Darkfish
|
|
416
425
|
search_index_rel_prefix = rel_prefix
|
417
426
|
search_index_rel_prefix += @asset_rel_path if @file_output
|
418
427
|
|
419
|
-
|
420
|
-
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
|
428
|
+
asset_rel_prefix = rel_prefix + @asset_rel_path
|
421
429
|
|
422
430
|
unless filepage_file then
|
423
431
|
if file.text? then
|
@@ -434,7 +442,13 @@ class RDoc::Generator::Darkfish
|
|
434
442
|
@title += " - #{@options.title}"
|
435
443
|
template_file ||= filepage_file
|
436
444
|
|
437
|
-
render_template template_file, out_file do |io|
|
445
|
+
render_template template_file, out_file do |io|
|
446
|
+
here = binding
|
447
|
+
# suppress 1.9.3 warning
|
448
|
+
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
|
449
|
+
here.local_variable_set(:current, current)
|
450
|
+
here
|
451
|
+
end
|
438
452
|
end
|
439
453
|
rescue => e
|
440
454
|
error =
|
@@ -458,14 +472,19 @@ class RDoc::Generator::Darkfish
|
|
458
472
|
search_index_rel_prefix = rel_prefix
|
459
473
|
search_index_rel_prefix += @asset_rel_path if @file_output
|
460
474
|
|
461
|
-
|
462
|
-
|
463
|
-
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
|
475
|
+
current = file
|
476
|
+
asset_rel_prefix = rel_prefix + @asset_rel_path
|
464
477
|
|
465
478
|
@title = "#{file.page_name} - #{@options.title}"
|
466
479
|
|
467
480
|
debug_msg " rendering #{out_file}"
|
468
|
-
render_template template_file, out_file do |io|
|
481
|
+
render_template template_file, out_file do |io|
|
482
|
+
here = binding
|
483
|
+
# suppress 1.9.3 warning
|
484
|
+
here.local_variable_set(:current, current)
|
485
|
+
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
|
486
|
+
here
|
487
|
+
end
|
469
488
|
end
|
470
489
|
|
471
490
|
##
|
@@ -483,12 +502,16 @@ class RDoc::Generator::Darkfish
|
|
483
502
|
search_index_rel_prefix = rel_prefix
|
484
503
|
search_index_rel_prefix += @asset_rel_path if @file_output
|
485
504
|
|
486
|
-
|
487
|
-
asset_rel_prefix = asset_rel_prefix = ''
|
505
|
+
asset_rel_prefix = ''
|
488
506
|
|
489
507
|
@title = 'Not Found'
|
490
508
|
|
491
|
-
render_template template_file do |io|
|
509
|
+
render_template template_file do |io|
|
510
|
+
here = binding
|
511
|
+
# suppress 1.9.3 warning
|
512
|
+
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
|
513
|
+
here
|
514
|
+
end
|
492
515
|
rescue => e
|
493
516
|
error = RDoc::Error.new \
|
494
517
|
"error generating servlet_not_found: #{e.message} (#{e.class})"
|
@@ -540,12 +563,16 @@ class RDoc::Generator::Darkfish
|
|
540
563
|
search_index_rel_prefix = rel_prefix
|
541
564
|
search_index_rel_prefix += @asset_rel_path if @file_output
|
542
565
|
|
543
|
-
|
544
|
-
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
|
566
|
+
asset_rel_prefix = rel_prefix + @asset_rel_path
|
545
567
|
|
546
568
|
@title = "Table of Contents - #{@options.title}"
|
547
569
|
|
548
|
-
render_template template_file, out_file do |io|
|
570
|
+
render_template template_file, out_file do |io|
|
571
|
+
here = binding
|
572
|
+
# suppress 1.9.3 warning
|
573
|
+
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
|
574
|
+
here
|
575
|
+
end
|
549
576
|
rescue => e
|
550
577
|
error = RDoc::Error.new \
|
551
578
|
"error generating table_of_contents.html: #{e.message} (#{e.class})"
|