mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Raise an error if paths isn't an array or hash
This commit is contained in:
@@ -20,13 +20,16 @@ module Linguist
|
||||
#
|
||||
# Returns a Repository
|
||||
def initialize(paths)
|
||||
if paths.is_a?(Array)
|
||||
case paths
|
||||
when Array
|
||||
@paths = paths.inject({}) do |h, blob|
|
||||
h[blob.name] = blob
|
||||
h
|
||||
end
|
||||
else
|
||||
when Hash
|
||||
@paths = paths
|
||||
else
|
||||
raise ArgumentError, "#{paths.class} is not an Array or Hash"
|
||||
end
|
||||
|
||||
@computed_stats = false
|
||||
|
||||
Reference in New Issue
Block a user