mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Change FileBlob to accept a base path
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user