2011-12-05 23:49:52 +00:00
|
|
|
module Jasmine::Headless::FileChecker
|
|
|
|
def bad_format?(file)
|
|
|
|
return if file.nil?
|
2011-12-06 14:31:23 +00:00
|
|
|
|
|
|
|
::Jasmine::Headless::EXCLUDED_FORMATS.any? do |format|
|
|
|
|
file[%r{\.#{format}(\.|$)}]
|
|
|
|
end
|
2011-12-05 23:49:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def alert_bad_format(file)
|
|
|
|
puts "[%s] %s: %s" % [ 'Skipping File'.color(:red), file.color(:yellow), "unsupported format".color(:white) ]
|
|
|
|
end
|
2011-12-06 14:31:23 +00:00
|
|
|
|
|
|
|
def alert_if_bad_format?(file)
|
|
|
|
if result = bad_format?(file)
|
|
|
|
alert_bad_format(file)
|
|
|
|
end
|
|
|
|
|
|
|
|
result
|
|
|
|
end
|
|
|
|
end
|