Project

General

Profile

Actions

Bug #1803

closed

rdocがサイズ0のファイルのバイナリ判定に失敗する

Added by sakuro (Sakuro OZAWA) almost 15 years ago. Updated about 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-07-22 trunk 24235) [i386-darwin9.7.0]
Backport:
[ruby-dev:38848]

Description

=begin
rspec-rails 1.2.7.1 のgem install中、generators/rspec/templates/previous_failures.txt の処理でエラーが発生しました。

Installing ri documentation for rspec-rails-1.2.7.1...
ERROR: While executing gem ... (NoMethodError)
undefined method `empty?' for nil:NilClass

lib/rdoc/parser.rb

68 def self.binary?(file)
69 s = File.read(file, 1024)
70 s.count("^ -~\t\r\n").fdiv(s.size) > 0.3 || s.index("\x00") unless s.empty?
71 end

69行めのFile.read は length が指定されているため、file のサイズが 0 だといきなり nil が返ります。
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24297.
=end

Actions

Also available in: Atom PDF

Like0
Like0