Change FileBlob to accept a base path

This commit is contained in:
Joshua Peek
2011-05-25 13:12:01 -05:00
parent ed9888cf9c
commit a00013a077
3 changed files with 10 additions and 6 deletions

View File

@@ -10,8 +10,8 @@ module Linguist
def self.from_directory(base_path)
paths = Dir["#{base_path}/**/*"].inject({}) do |h, path|
if File.file?(path)
name = path.sub("#{base_path}/", '')
h[name] = FileBlob.new(path, name)
blob = FileBlob.new(path, base_path)
h[blob.name] = blob
end
h
end