Sha256: 1c13c6391820a699ce719cd8ccee65b426f23677b70a474d543f2c4998eba385

Contents?: true

Size: 531 Bytes

Versions: 7

Compression:

Stored size: 531 Bytes

Contents

module EmberCLI
  class Middleware
    def initialize(app)
      @app = app
    end

    def call(env)
      enable_ember_cli
      EmberCLI.wait!

      if env["PATH_INFO"] == "/testem.js"
        [ 200, { "Content-Type" => "text/javascript" }, [""] ]
      else
        @app.call(env)
      end
    end

    private

    def enable_ember_cli
      @enabled ||= begin
        if Helpers.use_live_recompilation?
          EmberCLI.run!
        else
          EmberCLI.compile!
        end

        true
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ember-cli-rails-0.1.13 lib/ember-cli/middleware.rb
ember-cli-rails-0.1.12 lib/ember-cli/middleware.rb
ember-cli-rails-0.1.11 lib/ember-cli/middleware.rb
ember-cli-rails-0.1.10 lib/ember-cli/middleware.rb
ember-cli-rails-0.1.9 lib/ember-cli/middleware.rb
ember-cli-rails-0.1.8 lib/ember-cli/middleware.rb
ember-cli-rails-0.1.7 lib/ember-cli/middleware.rb