File tree 1 file changed +10
-6
lines changed
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
110
110
options = default_options
111
111
112
112
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
-
117
113
opt . program_name = File . basename $0
118
114
opt . version = RDoc ::VERSION
119
115
opt . release = nil
@@ -345,9 +341,17 @@ def self.process_args argv
345
341
346
342
opt . separator nil
347
343
348
- opt . on ( "--dump=CACHE" , File ,
344
+ opt . on ( "--dump=CACHE" ,
349
345
"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 )
351
355
end
352
356
end
353
357
You can’t perform that action at this time.
0 commit comments