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