File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,6 @@ def self.process_args argv
110110 options = default_options
111111
112112 opts = OptionParser . new do |opt |
113- opt . accept File do |file , |
114- File . readable? ( file ) and not File . directory? ( file ) and file
115- end
116-
117113 opt . program_name = File . basename $0
118114 opt . version = RDoc ::VERSION
119115 opt . release = nil
@@ -345,9 +341,17 @@ def self.process_args argv
345341
346342 opt . separator nil
347343
348- opt . on ( "--dump=CACHE" , File ,
344+ opt . on ( "--dump=CACHE" ,
349345 "Dump data from an ri cache or data file." ) do |value |
350- options [ :dump_path ] = value
346+ unless File . readable? ( value )
347+ abort "#{ value . inspect } is not readable"
348+ end
349+
350+ if File . directory? ( value )
351+ abort "#{ value . inspect } is a directory"
352+ end
353+
354+ options [ :dump_path ] = File . new ( value )
351355 end
352356 end
353357
You can’t perform that action at this time.
0 commit comments