lib/ember-cli/middleware.rb in ember-cli-rails-0.2.3 vs lib/ember-cli/middleware.rb in ember-cli-rails-0.3.0
- old
+ new
@@ -3,30 +3,16 @@
def initialize(app)
@app = app
end
def call(env)
- enable_ember_cli
- EmberCLI.wait!
+ path = env["PATH_INFO"].to_s
- if env["PATH_INFO"] == "/testem.js"
+ if path == "/testem.js"
[ 200, { "Content-Type" => "text/javascript" }, [""] ]
else
+ EmberCLI.process_path path
@app.call(env)
- end
- end
-
- private
-
- def enable_ember_cli
- @enabled ||= begin
- if EmberCLI.env.development?
- EmberCLI.run!
- else
- EmberCLI.compile!
- end
-
- true
end
end
end
end