3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/geminstaller/file_reader.rb', line 3
def read(file_path)
file_contents = nil
if !File.exist?(file_path) then
raise GemInstaller::MissingFileError.new("#{file_path}")
end
file = nil
begin
file = do_open(file_path)
rescue
raise GemInstaller::GemInstallerError.new("Error: Unable open file #{file_path}. Please ensure that this file can be opened.\n")
end
begin
do_read(file)
rescue
raise GemInstaller::GemInstallerError.new("Error: Unable read file #{file_path}. Please ensure that this file can be read.\n")
end
end
|