зеркало из https://github.com/github/grit.git
Ruby 1.9 compatibility
* Add current directory to path for tests because 1.9 does not * Explicity open file in binary mode to get around encoding issues
This commit is contained in:
Родитель
886960895d
Коммит
0a80ba282d
2
Rakefile
2
Rakefile
|
@ -47,7 +47,7 @@ task :default => :test
|
|||
|
||||
require 'rake/testtask'
|
||||
Rake::TestTask.new(:test) do |test|
|
||||
test.libs << 'lib' << 'test'
|
||||
test.libs << 'lib' << 'test' << '.'
|
||||
test.pattern = 'test/**/test_*.rb'
|
||||
test.verbose = true
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ module Grit
|
|||
begin
|
||||
return nil unless sha1[0...2] && sha1[2..39]
|
||||
path = @directory + '/' + sha1[0...2] + '/' + sha1[2..39]
|
||||
get_raw_object(File.read(path))
|
||||
get_raw_object(open(path, 'rb') { |f| f.read })
|
||||
rescue Errno::ENOENT
|
||||
nil
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче