Add FileBlob

This commit is contained in:
Joshua Peek
2011-05-25 12:52:12 -05:00
parent 0f0fc10106
commit 5a780fbdc1
4 changed files with 43 additions and 48 deletions

21
lib/linguist/file_blob.rb Normal file
View File

@@ -0,0 +1,21 @@
require 'linguist/blob_helper'
module Linguist
class FileBlob
include BlobHelper
def initialize(path, name = path)
@path, @name = path, name
end
attr_reader :name
def data
File.read(@path)
end
def size
File.size(@path)
end
end
end