# File lib/pry/code.rb, line 38 def from_file(fn, code_type = nil) if fn == Pry.eval_path f = Pry.line_buffer.drop(1) else if File.readable?(fn) f = File.open(fn, 'r') code_type = type_from_filename(fn) else raise MethodSource::SourceNotFoundError, "Cannot open #{fn.inspect} for reading." end end new(f, 1, code_type || :ruby) ensure f.close if f.respond_to?(:close) end