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/blob_helper'
|
||||||
require 'linguist/language'
|
require 'linguist/language'
|
||||||
require 'rugged'
|
require 'rugged'
|
||||||
|
require 'pry'
|
||||||
|
|
||||||
module Linguist
|
module Linguist
|
||||||
class LazyBlob
|
class LazyBlob
|
||||||
@@ -14,20 +15,18 @@ module Linguist
|
|||||||
|
|
||||||
attr_reader :repository
|
attr_reader :repository
|
||||||
attr_reader :oid
|
attr_reader :oid
|
||||||
attr_reader :name
|
attr_reader :path
|
||||||
attr_reader :mode
|
attr_reader :mode
|
||||||
|
|
||||||
def initialize(repo, oid, name, mode = nil)
|
alias :name :path
|
||||||
|
|
||||||
|
def initialize(repo, oid, path, mode = nil)
|
||||||
@repository = repo
|
@repository = repo
|
||||||
@oid = oid
|
@oid = oid
|
||||||
@name = name
|
@path = path
|
||||||
@mode = mode
|
@mode = mode
|
||||||
end
|
end
|
||||||
|
|
||||||
def path
|
|
||||||
name
|
|
||||||
end
|
|
||||||
|
|
||||||
def git_attributes
|
def git_attributes
|
||||||
@git_attributes ||= repository.fetch_attributes(
|
@git_attributes ||= repository.fetch_attributes(
|
||||||
name, GIT_ATTR, GIT_ATTR_FLAGS)
|
name, GIT_ATTR, GIT_ATTR_FLAGS)
|
||||||
|
|||||||
Reference in New Issue
Block a user