Raise an error is Language#name is missing

This commit is contained in:
Joshua Peek
2011-05-09 23:03:30 -05:00
parent 6041dda7ca
commit fdc8f18c52
2 changed files with 7 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ module Linguist
attr_reader :name, :extensions
def initialize(attributes = {})
@name = attributes[:name]
@name = attributes[:name] || raise(ArgumentError, "missing name")
@extensions = attributes[:extensions] || []
end
end