Sha256: 993bf9ebd0963f7bf981fec191159d3583d61d6cf4dfb0ec6e7c70da54e83fec

Contents?: true

Size: 836 Bytes

Versions: 2

Compression:

Stored size: 836 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.interface   ||= :bdd
      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

2 entries across 2 versions & 1 rubygems

Version Path
konacha-0.10.0 lib/konacha/engine.rb
konacha-0.9.1 lib/konacha/engine.rb