rdoc 6.0.1.1 → 6.0.2
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/.travis.yml +8 -6
- data/Rakefile +0 -50
- data/lib/rdoc.rb +2 -2
- data/lib/rdoc/context.rb +37 -14
- data/lib/rdoc/encoding.rb +27 -21
- data/lib/rdoc/erbio.rb +1 -1
- data/lib/rdoc/generator/json_index.rb +4 -1
- data/lib/rdoc/generator/pot.rb +3 -3
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +2 -5
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +1 -22
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +97 -21
- data/lib/rdoc/generator/template/darkfish/js/jquery.js +4 -0
- data/lib/rdoc/generator/template/darkfish/js/search.js +31 -32
- data/lib/rdoc/generator/template/json_index/js/navigation.js +40 -4
- data/lib/rdoc/generator/template/json_index/js/searcher.js +6 -6
- data/lib/rdoc/i18n.rb +1 -1
- data/lib/rdoc/markup/pre_process.rb +1 -0
- data/lib/rdoc/options.rb +1 -1
- data/lib/rdoc/parser.rb +1 -1
- data/lib/rdoc/parser/ripper_state_lex.rb +17 -3
- data/lib/rdoc/parser/ruby.rb +24 -11
- data/lib/rdoc/rdoc.rb +7 -12
- data/lib/rdoc/ri/driver.rb +28 -7
- data/lib/rdoc/servlet.rb +4 -3
- data/lib/rdoc/store.rb +17 -8
- data/lib/rdoc/text.rb +1 -1
- data/lib/rdoc/token_stream.rb +1 -1
- data/rdoc.gemspec +9 -5
- metadata +5 -18
- data/lib/rdoc/test_case.rb +0 -203
data/lib/rdoc/ri/driver.rb
CHANGED
@@ -110,7 +110,7 @@ class RDoc::RI::Driver
|
|
110
110
|
def self.dump data_path
|
111
111
|
require 'pp'
|
112
112
|
|
113
|
-
open data_path, 'rb' do |io|
|
113
|
+
File.open data_path, 'rb' do |io|
|
114
114
|
pp Marshal.load(io.read)
|
115
115
|
end
|
116
116
|
end
|
@@ -425,6 +425,7 @@ or the PAGER environment variable.
|
|
425
425
|
@server = options[:server]
|
426
426
|
@use_stdout = options[:use_stdout]
|
427
427
|
@show_all = options[:show_all]
|
428
|
+
@width = options[:width]
|
428
429
|
|
429
430
|
# pager process for jruby
|
430
431
|
@jruby_pager_process = nil
|
@@ -795,7 +796,9 @@ or the PAGER environment variable.
|
|
795
796
|
|
796
797
|
def display document
|
797
798
|
page do |io|
|
798
|
-
|
799
|
+
f = formatter(io)
|
800
|
+
f.width = @width if @width and f.respond_to?(:width)
|
801
|
+
text = document.accept f
|
799
802
|
|
800
803
|
io.write text
|
801
804
|
end
|
@@ -1440,7 +1443,13 @@ or the PAGER environment variable.
|
|
1440
1443
|
|
1441
1444
|
render_method_arguments out, method.arglists
|
1442
1445
|
render_method_superclass out, method
|
1443
|
-
|
1446
|
+
if method.is_alias_for
|
1447
|
+
al = method.is_alias_for
|
1448
|
+
alias_for = store.load_method al.parent_name, "#{al.name_prefix}#{al.name}"
|
1449
|
+
render_method_comment out, method, alias_for
|
1450
|
+
else
|
1451
|
+
render_method_comment out, method
|
1452
|
+
end
|
1444
1453
|
end
|
1445
1454
|
|
1446
1455
|
def render_method_arguments out, arglists # :nodoc:
|
@@ -1452,10 +1461,22 @@ or the PAGER environment variable.
|
|
1452
1461
|
out << RDoc::Markup::Rule.new(1)
|
1453
1462
|
end
|
1454
1463
|
|
1455
|
-
def render_method_comment out, method # :nodoc:
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1464
|
+
def render_method_comment out, method, alias_for = nil# :nodoc:
|
1465
|
+
if alias_for
|
1466
|
+
unless method.comment.nil? or method.comment.empty?
|
1467
|
+
out << RDoc::Markup::BlankLine.new
|
1468
|
+
out << method.comment
|
1469
|
+
end
|
1470
|
+
out << RDoc::Markup::BlankLine.new
|
1471
|
+
out << RDoc::Markup::Paragraph.new("(this method is alias for #{alias_for.full_name})")
|
1472
|
+
out << RDoc::Markup::BlankLine.new
|
1473
|
+
out << alias_for.comment
|
1474
|
+
out << RDoc::Markup::BlankLine.new
|
1475
|
+
else
|
1476
|
+
out << RDoc::Markup::BlankLine.new
|
1477
|
+
out << method.comment
|
1478
|
+
out << RDoc::Markup::BlankLine.new
|
1479
|
+
end
|
1459
1480
|
end
|
1460
1481
|
|
1461
1482
|
def render_method_superclass out, method # :nodoc:
|
data/lib/rdoc/servlet.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'rdoc'
|
3
|
+
require 'erb'
|
3
4
|
require 'time'
|
4
5
|
require 'json'
|
5
6
|
require 'webrick'
|
@@ -111,7 +112,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
|
|
111
112
|
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
|
112
113
|
|
113
114
|
def do_GET req, res
|
114
|
-
req.path
|
115
|
+
req.path.sub!(/^#{Regexp.escape @mount_path}/o, '') if @mount_path
|
115
116
|
|
116
117
|
case req.path
|
117
118
|
when '/' then
|
@@ -427,14 +428,14 @@ version. If you're viewing Ruby's documentation, include the version of ruby.
|
|
427
428
|
end
|
428
429
|
|
429
430
|
raise WEBrick::HTTPStatus::NotFound,
|
430
|
-
"Could not find gem \"#{source_name}\". Are you sure you installed it?" unless ri_dir
|
431
|
+
"Could not find gem \"#{ERB::Util.html_escape(source_name)}\". Are you sure you installed it?" unless ri_dir
|
431
432
|
|
432
433
|
store = RDoc::Store.new ri_dir, type
|
433
434
|
|
434
435
|
return store if File.exist? store.cache_path
|
435
436
|
|
436
437
|
raise WEBrick::HTTPStatus::NotFound,
|
437
|
-
"Could not find documentation for \"#{source_name}\". Please run `gem rdoc --ri gem_name`"
|
438
|
+
"Could not find documentation for \"#{ERB::Util.html_escape(source_name)}\". Please run `gem rdoc --ri gem_name`"
|
438
439
|
|
439
440
|
end
|
440
441
|
end
|
data/lib/rdoc/store.rb
CHANGED
@@ -116,6 +116,11 @@ class RDoc::Store
|
|
116
116
|
|
117
117
|
attr_accessor :encoding
|
118
118
|
|
119
|
+
##
|
120
|
+
# The lazy constants alias will be discovered in passing
|
121
|
+
|
122
|
+
attr_reader :unmatched_constant_alias
|
123
|
+
|
119
124
|
##
|
120
125
|
# Creates a new Store of +type+ that will load or save to +path+
|
121
126
|
|
@@ -152,6 +157,8 @@ class RDoc::Store
|
|
152
157
|
|
153
158
|
@unique_classes = nil
|
154
159
|
@unique_modules = nil
|
160
|
+
|
161
|
+
@unmatched_constant_alias = {}
|
155
162
|
end
|
156
163
|
|
157
164
|
##
|
@@ -539,7 +546,7 @@ class RDoc::Store
|
|
539
546
|
def load_cache
|
540
547
|
#orig_enc = @encoding
|
541
548
|
|
542
|
-
open cache_path, 'rb' do |io|
|
549
|
+
File.open cache_path, 'rb' do |io|
|
543
550
|
@cache = Marshal.load io.read
|
544
551
|
end
|
545
552
|
|
@@ -585,6 +592,8 @@ class RDoc::Store
|
|
585
592
|
case obj
|
586
593
|
when RDoc::NormalClass then
|
587
594
|
@classes_hash[klass_name] = obj
|
595
|
+
when RDoc::SingleClass then
|
596
|
+
@classes_hash[klass_name] = obj
|
588
597
|
when RDoc::NormalModule then
|
589
598
|
@modules_hash[klass_name] = obj
|
590
599
|
end
|
@@ -596,7 +605,7 @@ class RDoc::Store
|
|
596
605
|
def load_class_data klass_name
|
597
606
|
file = class_file klass_name
|
598
607
|
|
599
|
-
open file, 'rb' do |io|
|
608
|
+
File.open file, 'rb' do |io|
|
600
609
|
Marshal.load io.read
|
601
610
|
end
|
602
611
|
rescue Errno::ENOENT => e
|
@@ -611,7 +620,7 @@ class RDoc::Store
|
|
611
620
|
def load_method klass_name, method_name
|
612
621
|
file = method_file klass_name, method_name
|
613
622
|
|
614
|
-
open file, 'rb' do |io|
|
623
|
+
File.open file, 'rb' do |io|
|
615
624
|
obj = Marshal.load io.read
|
616
625
|
obj.store = self
|
617
626
|
obj.parent =
|
@@ -631,7 +640,7 @@ class RDoc::Store
|
|
631
640
|
def load_page page_name
|
632
641
|
file = page_file page_name
|
633
642
|
|
634
|
-
open file, 'rb' do |io|
|
643
|
+
File.open file, 'rb' do |io|
|
635
644
|
obj = Marshal.load io.read
|
636
645
|
obj.store = self
|
637
646
|
obj
|
@@ -778,7 +787,7 @@ class RDoc::Store
|
|
778
787
|
|
779
788
|
marshal = Marshal.dump @cache
|
780
789
|
|
781
|
-
open cache_path, 'wb' do |io|
|
790
|
+
File.open cache_path, 'wb' do |io|
|
782
791
|
io.write marshal
|
783
792
|
end
|
784
793
|
end
|
@@ -854,7 +863,7 @@ class RDoc::Store
|
|
854
863
|
|
855
864
|
marshal = Marshal.dump klass
|
856
865
|
|
857
|
-
open path, 'wb' do |io|
|
866
|
+
File.open path, 'wb' do |io|
|
858
867
|
io.write marshal
|
859
868
|
end
|
860
869
|
end
|
@@ -879,7 +888,7 @@ class RDoc::Store
|
|
879
888
|
|
880
889
|
marshal = Marshal.dump method
|
881
890
|
|
882
|
-
open method_file(full_name, method.full_name), 'wb' do |io|
|
891
|
+
File.open method_file(full_name, method.full_name), 'wb' do |io|
|
883
892
|
io.write marshal
|
884
893
|
end
|
885
894
|
end
|
@@ -901,7 +910,7 @@ class RDoc::Store
|
|
901
910
|
|
902
911
|
marshal = Marshal.dump page
|
903
912
|
|
904
|
-
open path, 'wb' do |io|
|
913
|
+
File.open path, 'wb' do |io|
|
905
914
|
io.write marshal
|
906
915
|
end
|
907
916
|
end
|
data/lib/rdoc/text.rb
CHANGED
@@ -169,7 +169,7 @@ module RDoc::Text
|
|
169
169
|
|
170
170
|
encoding = text.encoding
|
171
171
|
|
172
|
-
text = text.gsub %r%Document-method:\s+[\w
|
172
|
+
text = text.gsub %r%Document-method:\s+[\w:.#=!?|^&<>~+-/*\%@`\[\]]+%, ''
|
173
173
|
|
174
174
|
space = ' '
|
175
175
|
space = RDoc::Encoding.change_encoding space, encoding if encoding
|
data/lib/rdoc/token_stream.rb
CHANGED
data/rdoc.gemspec
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
begin
|
2
2
|
require_relative "lib/rdoc"
|
3
3
|
rescue LoadError
|
4
|
-
|
5
|
-
|
4
|
+
begin
|
5
|
+
# for Ruby repository
|
6
|
+
require_relative "../rdoc"
|
7
|
+
rescue LoadError
|
8
|
+
# for JRuby
|
9
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
10
|
+
require "rdoc"
|
11
|
+
end
|
6
12
|
end
|
7
13
|
|
8
14
|
Gem::Specification.new do |s|
|
9
15
|
s.name = "rdoc"
|
10
16
|
s.version = RDoc::VERSION
|
11
|
-
s.date = "2017-12-24"
|
12
17
|
|
13
18
|
s.authors = [
|
14
19
|
"Eric Hodel",
|
@@ -33,7 +38,7 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
|
|
33
38
|
s.executables = ["rdoc", "ri"]
|
34
39
|
s.require_paths = ["lib"]
|
35
40
|
# for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
36
|
-
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", "appveyor.yml", "bin/console", "bin/setup", "exe/rdoc", "exe/ri", "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/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/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/ripper_state_lex.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/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/
|
41
|
+
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", "appveyor.yml", "bin/console", "bin/setup", "exe/rdoc", "exe/ri", "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/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/ripper_state_lex.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/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/text.rb", "lib/rdoc/token_stream.rb", "lib/rdoc/tom_doc.rb", "lib/rdoc/top_level.rb", "rdoc.gemspec"]
|
37
42
|
# files from .gitignore
|
38
43
|
s.files << "lib/rdoc/rd/block_parser.rb" << "lib/rdoc/rd/inline_parser.rb" << "lib/rdoc/markdown.rb" << "lib/rdoc/markdown/literals.rb"
|
39
44
|
|
@@ -59,5 +64,4 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
|
|
59
64
|
s.add_development_dependency("racc", "> 1.4.10")
|
60
65
|
s.add_development_dependency("kpeg")
|
61
66
|
s.add_development_dependency("minitest", "~> 4")
|
62
|
-
s.add_development_dependency("json")
|
63
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Hodel
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: exe
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2018-03-17 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: rake
|
@@ -72,20 +72,6 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '4'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: json
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0'
|
89
75
|
description: |
|
90
76
|
RDoc produces HTML and command-line documentation for Ruby projects.
|
91
77
|
RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentation from the command-line.
|
@@ -211,6 +197,7 @@ files:
|
|
211
197
|
- lib/rdoc/generator/template/darkfish/images/zoom.png
|
212
198
|
- lib/rdoc/generator/template/darkfish/index.rhtml
|
213
199
|
- lib/rdoc/generator/template/darkfish/js/darkfish.js
|
200
|
+
- lib/rdoc/generator/template/darkfish/js/jquery.js
|
214
201
|
- lib/rdoc/generator/template/darkfish/js/search.js
|
215
202
|
- lib/rdoc/generator/template/darkfish/page.rhtml
|
216
203
|
- lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml
|
@@ -306,7 +293,6 @@ files:
|
|
306
293
|
- lib/rdoc/stats/verbose.rb
|
307
294
|
- lib/rdoc/store.rb
|
308
295
|
- lib/rdoc/task.rb
|
309
|
-
- lib/rdoc/test_case.rb
|
310
296
|
- lib/rdoc/text.rb
|
311
297
|
- lib/rdoc/token_stream.rb
|
312
298
|
- lib/rdoc/tom_doc.rb
|
@@ -333,7 +319,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
333
319
|
- !ruby/object:Gem::Version
|
334
320
|
version: '2.2'
|
335
321
|
requirements: []
|
336
|
-
|
322
|
+
rubyforge_project:
|
323
|
+
rubygems_version: 2.7.3
|
337
324
|
signing_key:
|
338
325
|
specification_version: 4
|
339
326
|
summary: RDoc produces HTML and command-line documentation for Ruby projects
|
data/lib/rdoc/test_case.rb
DELETED
@@ -1,203 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
begin
|
3
|
-
gem 'minitest', '~> 4.0' unless defined?(Test::Unit)
|
4
|
-
rescue NoMethodError, Gem::LoadError
|
5
|
-
# for ruby tests
|
6
|
-
end
|
7
|
-
|
8
|
-
require 'minitest/autorun'
|
9
|
-
require 'minitest/benchmark' unless ENV['NOBENCHMARK']
|
10
|
-
|
11
|
-
require 'fileutils'
|
12
|
-
require 'pp'
|
13
|
-
require 'tempfile'
|
14
|
-
require 'tmpdir'
|
15
|
-
require 'stringio'
|
16
|
-
|
17
|
-
require 'rdoc'
|
18
|
-
|
19
|
-
##
|
20
|
-
# RDoc::TestCase is an abstract TestCase to provide common setup and teardown
|
21
|
-
# across all RDoc tests. The test case uses minitest, so all the assertions
|
22
|
-
# of minitest may be used.
|
23
|
-
#
|
24
|
-
# The testcase provides the following:
|
25
|
-
#
|
26
|
-
# * A reset code-object tree
|
27
|
-
# * A reset markup preprocessor (RDoc::Markup::PreProcess)
|
28
|
-
# * The <code>@RM</code> alias of RDoc::Markup (for less typing)
|
29
|
-
# * <code>@pwd</code> containing the current working directory
|
30
|
-
# * FileUtils, pp, Tempfile, Dir.tmpdir and StringIO
|
31
|
-
|
32
|
-
class RDoc::TestCase < MiniTest::Unit::TestCase
|
33
|
-
|
34
|
-
##
|
35
|
-
# Abstract test-case setup
|
36
|
-
|
37
|
-
def setup
|
38
|
-
super
|
39
|
-
|
40
|
-
@top_level = nil
|
41
|
-
|
42
|
-
@RM = RDoc::Markup
|
43
|
-
|
44
|
-
RDoc::Markup::PreProcess.reset
|
45
|
-
|
46
|
-
@pwd = Dir.pwd
|
47
|
-
|
48
|
-
@store = RDoc::Store.new
|
49
|
-
|
50
|
-
@rdoc = RDoc::RDoc.new
|
51
|
-
@rdoc.store = @store
|
52
|
-
@rdoc.options = RDoc::Options.new
|
53
|
-
|
54
|
-
g = Object.new
|
55
|
-
def g.class_dir() end
|
56
|
-
def g.file_dir() end
|
57
|
-
@rdoc.generator = g
|
58
|
-
end
|
59
|
-
|
60
|
-
##
|
61
|
-
# Asserts +path+ is a file
|
62
|
-
|
63
|
-
def assert_file path
|
64
|
-
assert File.file?(path), "#{path} is not a file"
|
65
|
-
end
|
66
|
-
|
67
|
-
##
|
68
|
-
# Asserts +path+ is a directory
|
69
|
-
|
70
|
-
def assert_directory path
|
71
|
-
assert File.directory?(path), "#{path} is not a directory"
|
72
|
-
end
|
73
|
-
|
74
|
-
##
|
75
|
-
# Refutes +path+ exists
|
76
|
-
|
77
|
-
def refute_file path
|
78
|
-
refute File.exist?(path), "#{path} exists"
|
79
|
-
end
|
80
|
-
|
81
|
-
##
|
82
|
-
# Shortcut for RDoc::Markup::BlankLine.new
|
83
|
-
|
84
|
-
def blank_line
|
85
|
-
@RM::BlankLine.new
|
86
|
-
end
|
87
|
-
|
88
|
-
##
|
89
|
-
# Shortcut for RDoc::Markup::BlockQuote.new with +contents+
|
90
|
-
|
91
|
-
def block *contents
|
92
|
-
@RM::BlockQuote.new(*contents)
|
93
|
-
end
|
94
|
-
|
95
|
-
##
|
96
|
-
# Creates an RDoc::Comment with +text+ which was defined on +top_level+.
|
97
|
-
# By default the comment has the 'rdoc' format.
|
98
|
-
|
99
|
-
def comment text, top_level = @top_level
|
100
|
-
RDoc::Comment.new text, top_level
|
101
|
-
end
|
102
|
-
|
103
|
-
##
|
104
|
-
# Shortcut for RDoc::Markup::Document.new with +contents+
|
105
|
-
|
106
|
-
def doc *contents
|
107
|
-
@RM::Document.new(*contents)
|
108
|
-
end
|
109
|
-
|
110
|
-
##
|
111
|
-
# Shortcut for RDoc::Markup::HardBreak.new
|
112
|
-
|
113
|
-
def hard_break
|
114
|
-
@RM::HardBreak.new
|
115
|
-
end
|
116
|
-
|
117
|
-
##
|
118
|
-
# Shortcut for RDoc::Markup::Heading.new with +level+ and +text+
|
119
|
-
|
120
|
-
def head level, text
|
121
|
-
@RM::Heading.new level, text
|
122
|
-
end
|
123
|
-
|
124
|
-
##
|
125
|
-
# Shortcut for RDoc::Markup::ListItem.new with +label+ and +parts+
|
126
|
-
|
127
|
-
def item label = nil, *parts
|
128
|
-
@RM::ListItem.new label, *parts
|
129
|
-
end
|
130
|
-
|
131
|
-
##
|
132
|
-
# Shortcut for RDoc::Markup::List.new with +type+ and +items+
|
133
|
-
|
134
|
-
def list type = nil, *items
|
135
|
-
@RM::List.new type, *items
|
136
|
-
end
|
137
|
-
|
138
|
-
##
|
139
|
-
# Enables pretty-print output
|
140
|
-
|
141
|
-
def mu_pp obj # :nodoc:
|
142
|
-
s = obj.pretty_inspect
|
143
|
-
s = RDoc::Encoding.change_encoding s, Encoding.default_external
|
144
|
-
s.chomp
|
145
|
-
end
|
146
|
-
|
147
|
-
##
|
148
|
-
# Shortcut for RDoc::Markup::Paragraph.new with +contents+
|
149
|
-
|
150
|
-
def para *a
|
151
|
-
@RM::Paragraph.new(*a)
|
152
|
-
end
|
153
|
-
|
154
|
-
##
|
155
|
-
# Shortcut for RDoc::Markup::Rule.new with +weight+
|
156
|
-
|
157
|
-
def rule weight
|
158
|
-
@RM::Rule.new weight
|
159
|
-
end
|
160
|
-
|
161
|
-
##
|
162
|
-
# Shortcut for RDoc::Markup::Raw.new with +contents+
|
163
|
-
|
164
|
-
def raw *contents
|
165
|
-
@RM::Raw.new(*contents)
|
166
|
-
end
|
167
|
-
|
168
|
-
##
|
169
|
-
# Creates a temporary directory changes the current directory to it for the
|
170
|
-
# duration of the block.
|
171
|
-
#
|
172
|
-
# Depends upon Dir.mktmpdir
|
173
|
-
|
174
|
-
def temp_dir
|
175
|
-
Dir.mktmpdir do |temp_dir|
|
176
|
-
Dir.chdir temp_dir do
|
177
|
-
yield temp_dir
|
178
|
-
end
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
##
|
183
|
-
# Shortcut for RDoc::Markup::Verbatim.new with +parts+
|
184
|
-
|
185
|
-
def verb *parts
|
186
|
-
@RM::Verbatim.new(*parts)
|
187
|
-
end
|
188
|
-
|
189
|
-
##
|
190
|
-
# run capture_io with setting $VERBOSE = true
|
191
|
-
|
192
|
-
def verbose_capture_io
|
193
|
-
capture_io do
|
194
|
-
begin
|
195
|
-
orig_verbose = $VERBOSE
|
196
|
-
$VERBOSE = true
|
197
|
-
yield
|
198
|
-
ensure
|
199
|
-
$VERBOSE = orig_verbose
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
end
|