# File lib/cucumber/formatter/io.rb, line 25 25: def ensure_dir(path, name) 26: raise "You *must* specify --out DIR for the #{name} formatter" unless String === path 27: raise "I can't write #{name} reports to a file - it has to be a directory" if File.file?(path) 28: FileUtils.mkdir_p(path) unless File.directory?(path) 29: path 30: end
# File lib/cucumber/formatter/io.rb, line 19 19: def ensure_file(path, name) 20: raise "You *must* specify --out FILE for the #{name} formatter" unless String === path 21: raise "I can't write #{name} to a directory - it has to be a file" if File.directory?(path) 22: ensure_io(path, name) 23: end
# File lib/cucumber/formatter/io.rb, line 6 6: def ensure_io(path_or_io, name) 7: return nil if path_or_io.nil? 8: return path_or_io if ColorIO === path_or_io || path_or_io.respond_to?(:write) 9: file = File.open(path_or_io, Cucumber.file_mode('w')) 10: at_exit do 11: unless file.closed? 12: file.flush 13: file.close 14: end 15: end 16: file 17: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.