lib/ember-cli-rails.rb in ember-cli-rails-0.0.9 vs lib/ember-cli-rails.rb in ember-cli-rails-0.0.10

- old
+ new

@@ -5,10 +5,11 @@ autoload :App, "ember-cli/app" autoload :Configuration, "ember-cli/configuration" autoload :ViewHelpers, "ember-cli/view_helpers" autoload :Helpers, "ember-cli/helpers" + autoload :Middleware, "ember-cli/middleware" def configure yield configuration end @@ -24,24 +25,11 @@ end end def enable! prepare! - - Rails.application.singleton_class.class_eval do - alias_method :call_without_ember_cli, :call - - def call(env) - @_ember_cli_enabled ||= begin - EmberCLI.compile! - EmberCLI.run! if Rails.env.development? - true - end - - call_without_ember_cli(env) - end - end + Rails.configuration.middleware.use Middleware end def run! prepare! each_app &:run @@ -52,9 +40,13 @@ each_app &:compile end def stop! each_app &:stop + end + + def wait! + each_app &:wait end def root @root ||= Rails.root.join("tmp", "ember-cli-#{uid}") end