lib/middleman/jasmine/jasmine_sprockets_proxy.rb in middleman-jasmine-0.2.0 vs lib/middleman/jasmine/jasmine_sprockets_proxy.rb in middleman-jasmine-0.3.0

- old
+ new

@@ -8,12 +8,13 @@ def sprockets_app @@sprockets_app end - def configure(middleman_sprockets) - Jasmine.load_configuration_from_yaml + def configure(middleman_sprockets, config_file = nil) + raise "Config file not found" unless valid_config_file?(config_file) + Jasmine.load_configuration_from_yaml(config_file) @@jasmine_app = Jasmine::Application.app(Jasmine.config) @@sprockets_app = if defined?(::Sprockets::Environment) sprockets = ::Sprockets::Environment.new middleman_sprockets.paths.each do |path| @@ -23,10 +24,17 @@ sprockets else @@jasmine_app end end + + private + + def valid_config_file?(config_file) + return true if config_file.nil? + File.exist?(config_file) + end end def initialize(path="") @path = path @app = @@ -65,6 +73,6 @@ [@page.render] ] end end end -end \ No newline at end of file +end