diff options
| author | Joshua Peek <josh@joshpeek.com> | 2012-07-23 17:19:11 -0500 |
|---|---|---|
| committer | Joshua Peek <josh@joshpeek.com> | 2012-07-23 17:19:11 -0500 |
| commit | 65d05e02c95ee09c536733b35d1184885977ebab (patch) | |
| tree | 8719d4f46edbe09f5e35b91fbcc281898b5c5a61 | |
| parent | b4378ca89f60f3be69198c3d34047f4a6067bcd9 (diff) | |
name can be nil
| -rw-r--r-- | lib/linguist/blob_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 0dd3913..38e6d26 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -21,7 +21,7 @@ module Linguist # # Returns a String def extname - File.extname(name) + File.extname(name.to_s) end # Public: Get the actual blob mime type @@ -33,7 +33,7 @@ module Linguist # # Returns a mime type String. def mime_type - @mime_type ||= Mime.mime_for(extname) + @mime_type ||= Mime.mime_for(extname.to_s) end # Public: Get the Content-Type header value @@ -414,7 +414,7 @@ module Linguist disambiguate_extension_language || # See if there is a Language for the extension - Language.find_by_filename(name) || + Language.find_by_filename(name.to_s) || # Try to detect Language from shebang line shebang_language |
