jasmine-headless-webkit/lib/jasmine/headless/file_checker.rb
Marcus Mateus 0987d6acc9 Exposed sprockets_environment from Jasmine::Headless
* Allows for manipulation of the Sprockets::Environment for
    things like adding/removing pre/postprocessors from spec_helper.rb
 * Also, fixed specs that were failing on files_list.rb when
    run standalone due to missing require in file_checker.rb
2012-06-12 21:47:45 -05:00

28 lines
560 B
Ruby

require 'rainbow'
module Jasmine::Headless::FileChecker
def excluded_formats
::Jasmine::Headless::EXCLUDED_FORMATS
end
def bad_format?(file)
return if file.nil?
excluded_formats.any? do |format|
file[%r{\.#{format}(\.|$)}]
end
end
def alert_bad_format(file)
Jasmine::Headless.warn("[%s] %s: %s" % [ 'Skipping File'.color(:red), file.color(:yellow), "unsupported format".color(:white) ])
end
def alert_if_bad_format?(file)
if result = bad_format?(file)
alert_bad_format(file)
end
result
end
end