mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Handle nil blob names
This commit is contained in:
@@ -34,7 +34,7 @@ module Linguist
|
|||||||
|
|
||||||
# Public: Read file permissions
|
# Public: Read file permissions
|
||||||
#
|
#
|
||||||
# Returns a String like '0100644'
|
# Returns a String like '100644'
|
||||||
def mode
|
def mode
|
||||||
File.stat(@path).mode.to_s(8)
|
File.stat(@path).mode.to_s(8)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns Language or nil.
|
# Returns Language or nil.
|
||||||
def self.detect(blob)
|
def self.detect(blob)
|
||||||
name = blob.name
|
name = blob.name.to_s
|
||||||
|
|
||||||
# A bit of an elegant hack. If the file is executable but extensionless,
|
# A bit of an elegant hack. If the file is executable but extensionless,
|
||||||
# append a "magic" extension so it can be classified with other
|
# append a "magic" extension so it can be classified with other
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module Linguist
|
module Linguist
|
||||||
VERSION = "2.13.0.github3"
|
VERSION = "2.13.0.github4"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user