Start using path with LazyBlob

This commit is contained in:
Arfon Smith
2015-01-08 15:08:28 -06:00
parent 1f429fb488
commit efd25ec4d2

View File

@@ -1,6 +1,7 @@
require 'linguist/blob_helper'
require 'linguist/language'
require 'rugged'
require 'pry'
module Linguist
class LazyBlob
@@ -14,20 +15,18 @@ module Linguist
attr_reader :repository
attr_reader :oid
attr_reader :name
attr_reader :path
attr_reader :mode
def initialize(repo, oid, name, mode = nil)
alias :name :path
def initialize(repo, oid, path, mode = nil)
@repository = repo
@oid = oid
@name = name
@path = path
@mode = mode
end
def path
name
end
def git_attributes
@git_attributes ||= repository.fetch_attributes(
name, GIT_ATTR, GIT_ATTR_FLAGS)