mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Use path for Generated?
This commit is contained in:
@@ -301,7 +301,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Return true or false
|
# Return true or false
|
||||||
def generated?
|
def generated?
|
||||||
@_generated ||= Generated.generated?(name, lambda { data })
|
@_generated ||= Generated.generated?(path, lambda { data })
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Detects the Language of the blob.
|
# Public: Detects the Language of the blob.
|
||||||
|
|||||||
@@ -32,6 +32,17 @@ module Linguist
|
|||||||
# Returns a String
|
# Returns a String
|
||||||
attr_reader :name
|
attr_reader :name
|
||||||
|
|
||||||
|
# Public: Filename with Path
|
||||||
|
#
|
||||||
|
# Examples
|
||||||
|
#
|
||||||
|
# FileBlob.new("/path/to/linguist/lib/linguist.rb").path
|
||||||
|
# # => "/path/to/linguist/lib/linguist.rb"
|
||||||
|
#
|
||||||
|
# Returns a String
|
||||||
|
attr_reader :path
|
||||||
|
|
||||||
|
|
||||||
# Public: Read file permissions
|
# Public: Read file permissions
|
||||||
#
|
#
|
||||||
# Returns a String like '100644'
|
# Returns a String like '100644'
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ module Linguist
|
|||||||
@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