mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
* Separate find_by_extension and find_by_filename find_by_extension now takes a path as argument and not only the file extension. Currently only find_by_extension is used as a strategy. * Add find_by_filename as first strategy
12 lines
221 B
Ruby
12 lines
221 B
Ruby
module Linguist
|
|
module Strategy
|
|
# Detects language based on filename
|
|
class Filename
|
|
def self.call(blob, _)
|
|
name = blob.name.to_s
|
|
Language.find_by_filename(name)
|
|
end
|
|
end
|
|
end
|
|
end
|