Use path for Generated?

This commit is contained in:
Arfon Smith
2015-01-08 14:03:35 -06:00
parent 7e319b797f
commit ec28ea299f
3 changed files with 16 additions and 1 deletions

View File

@@ -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.

View File

@@ -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'

View File

@@ -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)