rdoc 5.1.0 → 6.0.0.beta1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9174b0195d9838a298a513ba2085d112124c7794
4
- data.tar.gz: 2004a3d7156daa611a1d889f9ea9c6c1fa3e5258
3
+ metadata.gz: 3806537c526d973e02f6e7c7b73ba88d56bd29f0
4
+ data.tar.gz: 12c3bcb2879e2d188cf2067202999cb6e7417ba7
5
5
  SHA512:
6
- metadata.gz: '092085cdf5a1d41d6c317ad6574f8b36b09f2658df2736fb19dcb4f475df81d3b8db6172a8a2cc1c342aef8a791b6c0b432dce2d7e158b0086f1a95c2b34d40c'
7
- data.tar.gz: 6f206046fd878159a867e3d394deb4ddf5f37a3f437bf314cfd214f6b11e5ab1c2f5d81cadef42ac04fec22396e90f463cfb4e1169877380968a9e45cb1dfabe
6
+ metadata.gz: '009cbfdd5ddf8238ca4219bcf1a44974ea3fc16c794929e03595e8e3713eb130c7c2ed43667d702363586d89b9b52323fab680d4a9102ba79bfc33d1514c5efc'
7
+ data.tar.gz: 02cb698212d59e25b3799becb7a743503eaa762e2dfc863cdc99facaf500a03969550ac6198286bee076611677eaa3b9e0e241d6db3f4b3cb4611c14943b607b
@@ -6,19 +6,19 @@ notifications:
6
6
  email:
7
7
  - mail@zzak.io
8
8
  rvm:
9
- - 1.9.3
10
- - 2.0.0
11
- - 2.1.10
12
- - 2.2.6
13
- - 2.3.3
14
- - 2.4.0
9
+ - 2.2.7
10
+ - 2.3.4
11
+ - 2.4.1
15
12
  - ruby-head
16
13
  - rbx-2
17
- - jruby-1.7.25
18
- - jruby-9.1.0.0
14
+ - jruby-1.7.26
15
+ - jruby-9.1.9.0
16
+ env:
17
+ global:
18
+ NOBENCHMARK=1
19
19
  script: rake
20
20
  matrix:
21
21
  allow_failures:
22
- - rvm: jruby-1.7.25
23
- - rvm: jruby-9.1.0.0
22
+ - rvm: jruby-1.7.26
23
+ - rvm: jruby-9.1.9.0
24
24
  - rvm: rbx-2
@@ -1,12 +1,12 @@
1
1
  === 5.1.0 / 2017-02-24
2
2
 
3
3
  * Bug fixes
4
- * Fix an issue that rdoc fails when running on Windows with RUBYOPT=-U.
5
- PR #430 by Toshihiko Ichida
4
+ * Fix an issue that rdoc fails when running on Windows with RUBYOPT=-U.
5
+ PR #430 by Toshihiko Ichida
6
6
 
7
7
  * Minor enhancements
8
- * Parse ruby 2.1 <visibility> def. PR #436 by Akira Matsuda.
9
- * Suppress warnings in eval. PR #440 by Nobuyoshi Nakada.
8
+ * Parse ruby 2.1 <visibility> def. PR #436 by Akira Matsuda.
9
+ * Suppress warnings in eval. PR #440 by Nobuyoshi Nakada.
10
10
 
11
11
  === 5.0.0 / 2016-11-05
12
12
 
@@ -1,10 +1,10 @@
1
1
  = \RDoc - Ruby Documentation System
2
2
 
3
- home :: https://github.com/rdoc/rdoc
4
- rdoc :: https://rdoc.github.io/rdoc
5
- bugs :: https://github.com/rdoc/rdoc/issues
6
- build status :: {<img src="https://travis-ci.org/rdoc/rdoc.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/rdoc/rdoc]
7
- code quality :: {<img src="https://codeclimate.com/github/rdoc/rdoc/badges/gpa.svg" alt="Code Climate">}[https://codeclimate.com/github/rdoc/rdoc]
3
+ home :: https://github.com/ruby/rdoc
4
+ rdoc :: https://ruby.github.io/rdoc
5
+ bugs :: https://github.com/ruby/rdoc/issues
6
+ build status :: {<img src="https://travis-ci.org/ruby/rdoc.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/ruby/rdoc]
7
+ code quality :: {<img src="https://codeclimate.com/github/ruby/rdoc/badges/gpa.svg" alt="Code Climate">}[https://codeclimate.com/github/ruby/rdoc]
8
8
 
9
9
  == Description
10
10
 
data/Rakefile CHANGED
@@ -3,8 +3,6 @@ require 'rdoc/task'
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rake/testtask'
5
5
 
6
- ENV['BENCHMARK'] = 'yes'
7
-
8
6
  task :docs => :generate
9
7
  task :test => :generate
10
8
 
@@ -65,7 +65,7 @@ module RDoc
65
65
  ##
66
66
  # RDoc version you are using
67
67
 
68
- VERSION = '5.1.0'
68
+ VERSION = '6.0.0.beta1'
69
69
 
70
70
  ##
71
71
  # Method visibilities
@@ -69,13 +69,6 @@ class RDoc::CodeObject
69
69
 
70
70
  attr_reader :metadata
71
71
 
72
- ##
73
- # Offset in #file where this CodeObject was defined
74
- #--
75
- # TODO character or byte?
76
-
77
- attr_accessor :offset
78
-
79
72
  ##
80
73
  # Sets the parent CodeObject
81
74
 
@@ -762,7 +762,7 @@ class RDoc::Context < RDoc::CodeObject
762
762
  attributes.default = []
763
763
 
764
764
  sort_sections.each do |section|
765
- yield section, constants[section].sort, attributes[section].sort
765
+ yield section, constants[section].select(&:display?).sort, attributes[section].select(&:display?).sort
766
766
  end
767
767
  end
768
768
 
@@ -26,8 +26,6 @@
26
26
  </section>
27
27
 
28
28
  <% klass.each_section do |section, constants, attributes| %>
29
- <% constants = constants.select { |const| const.display? } %>
30
- <% attributes = attributes.select { |attr| attr.display? } %>
31
29
  <section id="<%= section.aref %>" class="documentation-section">
32
30
  <% if section.title then %>
33
31
  <header class="documentation-section-title">
@@ -670,7 +670,6 @@ class RDoc::Parser::C < RDoc::Parser
670
670
  tk.set_text body
671
671
  meth_obj.add_token tk
672
672
  meth_obj.comment = comment
673
- meth_obj.offset = offset
674
673
  meth_obj.line = file_content[0, offset].count("\n") + 1
675
674
 
676
675
  body
@@ -689,7 +688,6 @@ class RDoc::Parser::C < RDoc::Parser
689
688
  tk.set_text body
690
689
  meth_obj.add_token tk
691
690
  meth_obj.comment = comment
692
- meth_obj.offset = offset
693
691
  meth_obj.line = file_content[0, offset].count("\n") + 1
694
692
 
695
693
  body
@@ -589,7 +589,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
589
589
  # +comment+.
590
590
 
591
591
  def parse_attr(context, single, tk, comment)
592
- offset = tk.seek
593
592
  line_no = tk.line_no
594
593
 
595
594
  args = parse_symbol_arg 1
@@ -606,7 +605,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
606
605
  end
607
606
 
608
607
  att = create_attr context, single, name, rw, comment
609
- att.offset = offset
610
608
  att.line = line_no
611
609
 
612
610
  read_documentation_modifiers att, RDoc::ATTR_MODIFIERS
@@ -620,7 +618,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
620
618
  # comment for each to +comment+.
621
619
 
622
620
  def parse_attr_accessor(context, single, tk, comment)
623
- offset = tk.seek
624
621
  line_no = tk.line_no
625
622
 
626
623
  args = parse_symbol_arg
@@ -642,7 +639,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
642
639
 
643
640
  for name in args
644
641
  att = create_attr context, single, name, rw, comment
645
- att.offset = offset
646
642
  att.line = line_no
647
643
  end
648
644
  end
@@ -651,7 +647,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
651
647
  # Parses an +alias+ in +context+ with +comment+
652
648
 
653
649
  def parse_alias(context, single, tk, comment)
654
- offset = tk.seek
655
650
  line_no = tk.line_no
656
651
 
657
652
  skip_tkspace
@@ -680,7 +675,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
680
675
  al = RDoc::Alias.new(get_tkread, old_name, new_name, comment,
681
676
  single == SINGLE)
682
677
  record_location al
683
- al.offset = offset
684
678
  al.line = line_no
685
679
 
686
680
  read_documentation_modifiers al, RDoc::ATTR_MODIFIERS
@@ -733,7 +727,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
733
727
  # Parses a class in +context+ with +comment+
734
728
 
735
729
  def parse_class container, single, tk, comment
736
- offset = tk.seek
737
730
  line_no = tk.line_no
738
731
 
739
732
  declaration_context = container
@@ -748,7 +741,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
748
741
  case name = get_class_specification
749
742
  when 'self', container.name
750
743
  parse_statements container, SINGLE
751
- return # don't update offset or line
744
+ return # don't update line
752
745
  else
753
746
  parse_class_singleton container, name, comment
754
747
  end
@@ -757,9 +750,11 @@ class RDoc::Parser::Ruby < RDoc::Parser
757
750
  return
758
751
  end
759
752
 
760
- cls.offset = offset
761
753
  cls.line = line_no
762
754
 
755
+ # after end modifiers
756
+ read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
757
+
763
758
  cls
764
759
  end
765
760
 
@@ -845,7 +840,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
845
840
  # true, no found constants will be added to RDoc.
846
841
 
847
842
  def parse_constant container, tk, comment, ignore_constants = false
848
- offset = tk.seek
849
843
  line_no = tk.line_no
850
844
 
851
845
  name = tk.name
@@ -885,7 +879,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
885
879
 
886
880
  value.replace body
887
881
  record_location con
888
- con.offset = offset
889
882
  con.line = line_no
890
883
  read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS
891
884
 
@@ -950,7 +943,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
950
943
  def parse_comment container, tk, comment
951
944
  return parse_comment_tomdoc container, tk, comment if @markup == 'tomdoc'
952
945
  column = tk.char_no
953
- offset = tk.seek
954
946
  line_no = tk.line_no
955
947
 
956
948
  text = comment.text
@@ -966,7 +958,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
966
958
 
967
959
  if co then
968
960
  co.singleton = singleton
969
- co.offset = offset
970
961
  co.line = line_no
971
962
  end
972
963
 
@@ -1031,19 +1022,18 @@ class RDoc::Parser::Ruby < RDoc::Parser
1031
1022
 
1032
1023
  def parse_comment_tomdoc container, tk, comment
1033
1024
  return unless signature = RDoc::TomDoc.signature(comment)
1034
- offset = tk.seek
1025
+ column = tk.char_no
1035
1026
  line_no = tk.line_no
1036
1027
 
1037
1028
  name, = signature.split %r%[ \(]%, 2
1038
1029
 
1039
1030
  meth = RDoc::GhostMethod.new get_tkread, name
1040
1031
  record_location meth
1041
- meth.offset = offset
1042
1032
  meth.line = line_no
1043
1033
 
1044
1034
  meth.start_collecting_tokens
1045
1035
  indent = TkSPACE.new 0, 1, 1
1046
- indent.set_text " " * offset
1036
+ indent.set_text " " * column
1047
1037
 
1048
1038
  position_comment = TkCOMMENT.new 0, line_no, 1
1049
1039
  position_comment.set_text "# File #{@top_level.relative_name}, line #{line_no}"
@@ -1183,7 +1173,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
1183
1173
 
1184
1174
  def parse_meta_method(container, single, tk, comment)
1185
1175
  column = tk.char_no
1186
- offset = tk.seek
1187
1176
  line_no = tk.line_no
1188
1177
 
1189
1178
  start_collecting_tokens
@@ -1200,7 +1189,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
1200
1189
 
1201
1190
  meth = RDoc::MetaMethod.new get_tkread, name
1202
1191
  record_location meth
1203
- meth.offset = offset
1204
1192
  meth.line = line_no
1205
1193
  meth.singleton = singleton
1206
1194
 
@@ -1291,7 +1279,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
1291
1279
  added_container = false
1292
1280
  name = nil
1293
1281
  column = tk.char_no
1294
- offset = tk.seek
1295
1282
  line_no = tk.line_no
1296
1283
 
1297
1284
  start_collecting_tokens
@@ -1309,7 +1296,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
1309
1296
  meth.singleton = single == SINGLE ? true : singleton
1310
1297
 
1311
1298
  record_location meth
1312
- meth.offset = offset
1313
1299
  meth.line = line_no
1314
1300
 
1315
1301
  meth.start_collecting_tokens
@@ -1328,6 +1314,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
1328
1314
 
1329
1315
  meth.comment = comment
1330
1316
 
1317
+ # after end modifiers
1318
+ read_documentation_modifiers meth, RDoc::METHOD_MODIFIERS
1319
+
1331
1320
  @stats.add_method meth
1332
1321
  end
1333
1322
 
@@ -1519,6 +1508,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
1519
1508
  end
1520
1509
  tk = get_tk
1521
1510
  end
1511
+ @scanner.first_in_method_statement = true
1522
1512
 
1523
1513
  get_tkread_clean(/\s+/, ' ')
1524
1514
  end
@@ -1559,6 +1549,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
1559
1549
  mod.add_comment comment, @top_level
1560
1550
  parse_statements mod
1561
1551
 
1552
+ # after end modifiers
1553
+ read_documentation_modifiers mod, RDoc::CLASS_MODIFIERS
1554
+
1562
1555
  @stats.add_module mod
1563
1556
  end
1564
1557
 
@@ -1732,7 +1725,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
1732
1725
  when TkEND then
1733
1726
  nest -= 1
1734
1727
  if nest == 0 then
1735
- read_documentation_modifiers container, RDoc::CLASS_MODIFIERS
1736
1728
  container.ongoing_visibility = save_visibility
1737
1729
 
1738
1730
  parse_comment container, tk, comment unless comment.empty?
@@ -2039,7 +2031,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
2039
2031
  def skip_optional_do_after_expression
2040
2032
  skip_tkspace false
2041
2033
  tk = get_tk
2042
- end_token = get_end_token tk
2043
2034
 
2044
2035
  b_nest = 0
2045
2036
  nest = 0
@@ -2047,23 +2038,18 @@ class RDoc::Parser::Ruby < RDoc::Parser
2047
2038
 
2048
2039
  loop do
2049
2040
  case tk
2050
- when TkSEMICOLON then
2041
+ when TkSEMICOLON, TkNL then
2051
2042
  break if b_nest.zero?
2052
2043
  when TkLPAREN, TkfLPAREN then
2053
2044
  nest += 1
2045
+ when TkRPAREN then
2046
+ nest -= 1
2054
2047
  when TkBEGIN then
2055
2048
  b_nest += 1
2056
2049
  when TkEND then
2057
2050
  b_nest -= 1
2058
2051
  when TkDO
2059
2052
  break if nest.zero?
2060
- when end_token then
2061
- if end_token == TkRPAREN
2062
- nest -= 1
2063
- break if @scanner.lex_state == :EXPR_END and nest.zero?
2064
- else
2065
- break unless @scanner.continue
2066
- end
2067
2053
  when nil then
2068
2054
  break
2069
2055
  end
@@ -33,26 +33,6 @@ module RDoc::Parser::RubyTools
33
33
 
34
34
  tk = nil if TkEND_OF_SCRIPT === tk
35
35
 
36
- if TkSYMBEG === tk then
37
- set_token_position tk.line_no, tk.char_no
38
-
39
- case tk1 = get_tk
40
- when TkId, TkOp, TkSTRING, TkDSTRING, TkSTAR, TkAMPER then
41
- if tk1.respond_to?(:name) then
42
- tk = Token(TkSYMBOL).set_text(":" + tk1.name)
43
- else
44
- tk = Token(TkSYMBOL).set_text(":" + tk1.text)
45
- end
46
-
47
- # remove the identifier we just read to replace it with a symbol
48
- @token_listeners.each do |obj|
49
- obj.pop_token
50
- end if @token_listeners
51
- else
52
- tk = tk1
53
- end
54
- end
55
-
56
36
  # inform any listeners of our shiny new token
57
37
  @token_listeners.each do |obj|
58
38
  obj.add_token(tk)
@@ -80,7 +80,6 @@ class RDoc::RI::Driver
80
80
  options[:interactive] = false
81
81
  options[:profile] = false
82
82
  options[:show_all] = false
83
- options[:use_cache] = true
84
83
  options[:use_stdout] = !$stdout.tty?
85
84
  options[:width] = 72
86
85
 
@@ -122,7 +121,7 @@ class RDoc::RI::Driver
122
121
  opt.summary_indent = ' ' * 4
123
122
 
124
123
  opt.banner = <<-EOT
125
- Usage: #{opt.program_name} [options] [names...]
124
+ Usage: #{opt.program_name} [options] [name ...]
126
125
 
127
126
  Where name can be:
128
127
 
@@ -132,8 +131,8 @@ Where name can be:
132
131
 
133
132
  gem_name: | gem_name:README | gem_name:History
134
133
 
135
- All class names may be abbreviated to their minimum unambiguous form. If a name
136
- is ambiguous, all valid options will be listed.
134
+ All class names may be abbreviated to their minimum unambiguous form.
135
+ If a name is ambiguous, all valid options will be listed.
137
136
 
138
137
  A '.' matches either class or instance methods, while #method
139
138
  matches only instance and ::method matches only class methods.
@@ -151,23 +150,23 @@ For example:
151
150
  #{opt.program_name} zip
152
151
  #{opt.program_name} rdoc:README
153
152
 
154
- Note that shell quoting or escaping may be required for method names containing
155
- punctuation:
153
+ Note that shell quoting or escaping may be required for method names
154
+ containing punctuation:
156
155
 
157
156
  #{opt.program_name} 'Array.[]'
158
157
  #{opt.program_name} compact\\!
159
158
 
160
- To see the default directories ri will search, run:
159
+ To see the default directories #{opt.program_name} will search, run:
161
160
 
162
161
  #{opt.program_name} --list-doc-dirs
163
162
 
164
- Specifying the --system, --site, --home, --gems or --doc-dir options will
165
- limit ri to searching only the specified directories.
163
+ Specifying the --system, --site, --home, --gems, or --doc-dir options
164
+ will limit ri to searching only the specified directories.
166
165
 
167
- ri options may be set in the 'RI' environment variable.
166
+ ri options may be set in the RI environment variable.
168
167
 
169
- The ri pager can be set with the 'RI_PAGER' environment variable or the
170
- 'PAGER' environment variable.
168
+ The ri pager can be set with the RI_PAGER environment variable
169
+ or the PAGER environment variable.
171
170
  EOT
172
171
 
173
172
  opt.separator nil
@@ -199,15 +198,15 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the
199
198
  opt.separator nil
200
199
 
201
200
  opt.on("--[no-]pager",
202
- "Send output directly to stdout,",
203
- "rather than to a pager.") do |use_pager|
201
+ "Send output to a pager,",
202
+ "rather than directly to stdout.") do |use_pager|
204
203
  options[:use_stdout] = !use_pager
205
204
  end
206
205
 
207
206
  opt.separator nil
208
207
 
209
208
  opt.on("-T",
210
- "Synonym for --no-pager") do
209
+ "Synonym for --no-pager.") do
211
210
  options[:use_stdout] = true
212
211
  end
213
212
 
@@ -220,7 +219,7 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the
220
219
 
221
220
  opt.separator nil
222
221
 
223
- opt.on("--server [PORT]", Integer,
222
+ opt.on("--server[=PORT]", Integer,
224
223
  "Run RDoc server on the given port.",
225
224
  "The default port is 8214.") do |port|
226
225
  options[:server] = port || 8214
@@ -235,13 +234,29 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the
235
234
  formatters -= %w[html label test] # remove useless output formats
236
235
 
237
236
  opt.on("--format=NAME", "-f",
238
- "Uses the selected formatter. The default",
237
+ "Use the selected formatter. The default",
239
238
  "formatter is bs for paged output and ansi",
240
- "otherwise. Valid formatters are:",
241
- formatters.join(' '), formatters) do |value|
239
+ "otherwise. Valid formatters are:",
240
+ "#{formatters.join(', ')}.", formatters) do |value|
242
241
  options[:formatter] = RDoc::Markup.const_get "To#{value.capitalize}"
243
242
  end
244
243
 
244
+ opt.separator nil
245
+
246
+ opt.on("--help", "-h",
247
+ "Show help and exit.") do
248
+ puts opts
249
+ exit
250
+ end
251
+
252
+ opt.separator nil
253
+
254
+ opt.on("--version", "-v",
255
+ "Output version information and exit.") do
256
+ puts "#{opts.program_name} #{opts.version}"
257
+ exit
258
+ end
259
+
245
260
  opt.separator nil
246
261
  opt.separator "Data source options:"
247
262
  opt.separator nil
@@ -273,7 +288,7 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the
273
288
  "Do not include documentation from",
274
289
  "the Ruby standard library, site_lib,",
275
290
  "installed gems, or ~/.rdoc.",
276
- "Use with --doc-dir") do
291
+ "Use with --doc-dir.") do
277
292
  options[:use_system] = false
278
293
  options[:use_site] = false
279
294
  options[:use_gems] = false
@@ -283,8 +298,8 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the
283
298
  opt.separator nil
284
299
 
285
300
  opt.on("--[no-]system",
286
- "Include documentation from Ruby's standard",
287
- "library. Defaults to true.") do |value|
301
+ "Include documentation from Ruby's",
302
+ "standard library. Defaults to true.") do |value|
288
303
  options[:use_system] = value
289
304
  end
290
305
 
@@ -318,14 +333,14 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the
318
333
  opt.separator nil
319
334
 
320
335
  opt.on("--[no-]profile",
321
- "Run with the ruby profiler") do |value|
336
+ "Run with the ruby profiler.") do |value|
322
337
  options[:profile] = value
323
338
  end
324
339
 
325
340
  opt.separator nil
326
341
 
327
342
  opt.on("--dump=CACHE", File,
328
- "Dumps data from an ri cache or data file") do |value|
343
+ "Dump data from an ri cache or data file.") do |value|
329
344
  options[:dump_path] = value
330
345
  end
331
346
  end