Sha256: c55a5d0d7949a3cbcfa47c3835729e9794b16f9ba6d9ad39535a7d28d5e80f66

Contents?: true

Size: 801 Bytes

Versions: 8

Compression:

Stored size: 801 Bytes

Contents

module Konacha
  class Engine < Rails::Engine
    config.konacha = ActiveSupport::OrderedOptions.new

    def self.application(app)
      Rack::Builder.app do
        map app.config.assets.prefix do
          run app.assets
        end

        map "/" do
          run Konacha::Engine
        end
      end
    end

    initializer "konacha.environment" do |app|
      unless app.config.assets.enabled
        raise RuntimeError, "konacha requires the asset pipeline to be enabled"
      end

      options = app.config.konacha

      options.spec_dir    ||= "spec/javascripts"
      options.port        ||= 3500
      options.application ||= self.class.application(app)
      options.driver      ||= :selenium

      app.config.assets.paths << app.root.join(options.spec_dir).to_s
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
konacha-1.2.1 lib/konacha/engine.rb
konacha-1.2.0 lib/konacha/engine.rb
konacha-1.1.3 lib/konacha/engine.rb
konacha-1.1.2 lib/konacha/engine.rb
konacha-1.1.1 lib/konacha/engine.rb
konacha-1.1.0 lib/konacha/engine.rb
konacha-1.0.0 lib/konacha/engine.rb
konacha-1.0.0.rc1 lib/konacha/engine.rb