mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add FileBlob
This commit is contained in:
21
lib/linguist/file_blob.rb
Normal file
21
lib/linguist/file_blob.rb
Normal 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
|
||||
Reference in New Issue
Block a user