rdoc 2.5.1 → 2.5.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.

data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- === 2.5.1 / 2010-04-?
1
+ === 2.5.2 / 2010-04-09
2
2
 
3
3
  *NOTE*:
4
4
 
@@ -19,10 +19,18 @@ To have ri data for you gems you'll also need to run:
19
19
 
20
20
  If you don't want to rebuild the rdoc for `gem server`, add --no-rdoc.
21
21
 
22
+ * 1 Minor Enhancements
23
+ * Imported various changes by Nobu from ruby trunk.
24
+ * 2 Bug Fixes
25
+ * RDoc parses files without extensions as text files again.
26
+ * RDoc::Parser::Ruby parses %{ strings correctly again.
27
+
28
+ === 2.5.1 / 2010-04-06
29
+
22
30
  * 1 Minor Enhancement
23
31
  * RDoc::Parser::C now supports the include directive for classes and
24
32
  modules.
25
- * N Bug Fixes
33
+ * 6 Bug Fixes
26
34
  * RDoc::AnyMethod params now get saved in ri data.
27
35
  * ri now displays method arguments correctly.
28
36
  * RDoc::Markup::Parser allows no space between = and header text like rdoc
@@ -33,18 +41,6 @@ If you don't want to rebuild the rdoc for `gem server`, add --no-rdoc.
33
41
 
34
42
  === 2.5 / 2010-03-31
35
43
 
36
- *NOTE*:
37
-
38
- You'll need to:
39
-
40
- gem install rdoc-data
41
-
42
- then run:
43
-
44
- rdoc-data
45
-
46
- to have ri data for core and stdlib like Array or Kernel or Date.
47
-
48
44
  * 9 Major Enhancements
49
45
  * Darkfish now has a "Home" button
50
46
  * ri no longer displays the value of a constant. There's no easy way to
@@ -101,6 +101,7 @@ lib/rdoc/task.rb
101
101
  lib/rdoc/text.rb
102
102
  lib/rdoc/tokenstream.rb
103
103
  lib/rdoc/top_level.rb
104
+ test/README
104
105
  test/binary.dat
105
106
  test/hidden.zip.txt
106
107
  test/test.ja.rdoc
@@ -383,7 +383,7 @@ module RDoc
383
383
  ##
384
384
  # RDoc version you are using
385
385
 
386
- VERSION = '2.5.1'
386
+ VERSION = '2.5.2'
387
387
 
388
388
  ##
389
389
  # Name of the dotfile that contains the description of files to be processed
@@ -1,12 +1,6 @@
1
1
  # -*- mode: ruby; ruby-indent-level: 2; tab-width: 2 -*-
2
2
  # vim: noet ts=2 sts=8 sw=2
3
3
 
4
- unless File.exist? File.expand_path('../.svn', __FILE__) then
5
- require 'rubygems'
6
- gem 'rdoc', '>= 2.4'
7
- end
8
-
9
- require 'pp'
10
4
  require 'pathname'
11
5
  require 'fileutils'
12
6
  require 'erb'
@@ -73,13 +73,12 @@ class RDoc::Parser
73
73
  true
74
74
  elsif file =~ /erb\.rb$/ then
75
75
  false
76
- elsif s.scan(/<%|%>/).length >= 4 then
76
+ elsif s.scan(/<%|%>/).length >= 4 || s.index("\x00") then
77
77
  true
78
- else
79
- # From ptools under the Artistic License 2.0, (c) Daniel Berger.
80
- s = s.split(//)
81
-
82
- ((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
78
+ elsif 0.respond_to? :fdiv then
79
+ s.count("^ -~\t\r\n").fdiv(s.size) > 0.3
80
+ else # HACK 1.8.6
81
+ (s.count("^ -~\t\r\n").to_f / s.size) > 0.3
83
82
  end
84
83
  end
85
84
 
@@ -105,7 +104,9 @@ class RDoc::Parser
105
104
  return if parser == RDoc::Parser::Simple and zip? file_name
106
105
 
107
106
  # The default parser must not parse binary files
108
- return if parser == RDoc::Parser::Simple and file_name !~ /\.(txt|rdoc)$/
107
+ ext_name = File.extname file_name
108
+ return parser if ext_name.empty?
109
+ return if parser == RDoc::Parser::Simple and ext_name !~ /txt|rdoc/
109
110
 
110
111
  parser
111
112
  end
@@ -390,10 +390,10 @@ class RDoc::Parser::C < RDoc::Parser
390
390
  void\s+
391
391
  Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)?\)}xmi then # )
392
392
  comment = $1
393
- elsif @content =~ %r{Document-(?:class|module):\s+#{class_name}\s*?(?:<\s+[:,\w]+)?\n((?>.*?\*/))}m then # "
393
+ elsif @content =~ %r{Document-(?:class|module):\s+#{class_name}\s*?(?:<\s+[:,\w]+)?\n((?>.*?\*/))}m then
394
394
  comment = $1
395
395
  elsif @content =~ %r{((?>/\*.*?\*/\s+))
396
- ([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(#{class_name})"}xm then
396
+ ([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(#{class_name})"}xm then # "
397
397
  comment = $1
398
398
  end
399
399
 
@@ -10,9 +10,15 @@ module RDoc::RI::Paths
10
10
 
11
11
  version = RbConfig::CONFIG['ruby_version']
12
12
 
13
- base = File.join RbConfig::CONFIG['datadir'], "ri", version
13
+ base = if RbConfig::CONFIG.key? 'ridir' then
14
+ File.join RbConfig::CONFIG['ridir'], version
15
+ else
16
+ File.join RbConfig::CONFIG['datadir'], 'ri', version
17
+ end
18
+
14
19
  SYSDIR = File.join base, "system"
15
20
  SITEDIR = File.join base, "site"
21
+
16
22
  homedir = File.expand_path('~') ||
17
23
  ENV['HOME'] || ENV['USERPROFILE'] || ENV['HOMEPATH']
18
24
 
@@ -359,6 +359,8 @@ class RDoc::RubyLex
359
359
  "(" => ")"
360
360
  }
361
361
 
362
+ PERCENT_PAREN_REV = PERCENT_PAREN.invert
363
+
362
364
  Ltype2Token = {
363
365
  "\'" => TkSTRING,
364
366
  "\"" => TkSTRING,
@@ -453,7 +455,7 @@ class RDoc::RubyLex
453
455
  if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
454
456
  (@lex_state != EXPR_ARG || @space_seen)
455
457
  c = peek(0)
456
- if /\S/ =~ c && (/["'`]/ =~ c || /[\w_]/ =~ c || c == "-")
458
+ if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-")
457
459
  tk = identify_here_document
458
460
  end
459
461
  end
@@ -1120,7 +1122,12 @@ class RDoc::RubyLex
1120
1122
  def identify_string(ltype, quoted = ltype)
1121
1123
  @ltype = ltype
1122
1124
  @quoted = quoted
1123
- str = @ltype.dup
1125
+
1126
+ str = if ltype == quoted then
1127
+ ltype.dup
1128
+ else
1129
+ "%#{PERCENT_PAREN_REV[quoted]}"
1130
+ end
1124
1131
 
1125
1132
  subtype = nil
1126
1133
  begin
@@ -1136,6 +1143,7 @@ class RDoc::RubyLex
1136
1143
  subtype = true
1137
1144
  if ch == "{" then
1138
1145
  str << ch << skip_inner_expression
1146
+ next
1139
1147
  else
1140
1148
  ungetc
1141
1149
  end
@@ -1179,7 +1187,7 @@ class RDoc::RubyLex
1179
1187
  def skip_inner_expression
1180
1188
  res = ""
1181
1189
  nest = 0
1182
- while (ch = getc)
1190
+ while ch = getc
1183
1191
  res << ch
1184
1192
  if ch == '}'
1185
1193
  break if nest.zero?
@@ -0,0 +1 @@
1
+ you don't have to
@@ -56,6 +56,9 @@ class TestRDocParser < MiniTest::Unit::TestCase
56
56
 
57
57
  jtest_rdoc_file_name = File.expand_path '../test.ja.rdoc', __FILE__
58
58
  assert_equal @RP::Simple, @RP.can_parse(jtest_rdoc_file_name)
59
+
60
+ readme_file_name = File.expand_path '../README', __FILE__
61
+ assert_equal @RP::Simple, @RP.can_parse(readme_file_name)
59
62
  end
60
63
 
61
64
  ##
@@ -1246,11 +1246,19 @@ end
1246
1246
 
1247
1247
  # If you're writing code like this you're doing it wrong
1248
1248
 
1249
- def x_test_sanity_interpolation_crazy
1249
+ def test_sanity_interpolation_crazy
1250
1250
  last_tk = nil
1251
1251
  util_parser '"#{"#{"a")}" if b}"'
1252
1252
 
1253
- assert_equal RDoc::RubyToken::TkDSTRING, tk.class
1253
+ assert_equal '"#{"#{"a")}" if b}"', @parser.get_tk.text
1254
+ assert_equal RDoc::RubyToken::TkNL, @parser.get_tk.class
1255
+ end
1256
+
1257
+ def test_sanity_interpolation_curly
1258
+ last_tk = nil
1259
+ util_parser '%{ #{} }'
1260
+
1261
+ assert_equal '%{ #{} }', @parser.get_tk.text
1254
1262
  assert_equal RDoc::RubyToken::TkNL, @parser.get_tk.class
1255
1263
  end
1256
1264
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 5
8
- - 1
9
- version: 2.5.1
8
+ - 2
9
+ version: 2.5.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Eric Hodel
@@ -38,7 +38,7 @@ cert_chain:
38
38
  x52qPcexcYZR7w==
39
39
  -----END CERTIFICATE-----
40
40
 
41
- date: 2010-04-06 00:00:00 -07:00
41
+ date: 2010-04-09 00:00:00 -07:00
42
42
  default_executable:
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
@@ -226,6 +226,7 @@ files:
226
226
  - lib/rdoc/text.rb
227
227
  - lib/rdoc/tokenstream.rb
228
228
  - lib/rdoc/top_level.rb
229
+ - test/README
229
230
  - test/binary.dat
230
231
  - test/hidden.zip.txt
231
232
  - test/test.ja.rdoc
metadata.gz.sig CHANGED
Binary file