mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-10 11:25:32 +00:00
Use path for Generated?
This commit is contained in:
@@ -301,7 +301,7 @@ module Linguist
|
||||
#
|
||||
# Return true or false
|
||||
def generated?
|
||||
@_generated ||= Generated.generated?(name, lambda { data })
|
||||
@_generated ||= Generated.generated?(path, lambda { data })
|
||||
end
|
||||
|
||||
# Public: Detects the Language of the blob.
|
||||
|
||||
@@ -32,6 +32,17 @@ module Linguist
|
||||
# Returns a String
|
||||
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
|
||||
#
|
||||
# Returns a String like '100644'
|
||||
|
||||
@@ -24,6 +24,10 @@ module Linguist
|
||||
@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