Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Mount Konacha::Engine to /konacha #25

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+17 −3
Split
View
@@ -1,4 +1,3 @@
Konacha::Engine.routes.draw do
- match "/" => "konacha/specs#specs"
- match "*path" => "konacha/specs#specs"
-end
+ match "(*path)" => "specs#specs"
+end
View
@@ -6,6 +6,11 @@ module Konacha
class << self
attr_accessor :mode
+ def mode
+ # defaults to :server
+ @mode ||= :server
+ end
+
def serve
puts "Your tests are here:"
puts " http://localhost:#{port}/"
View
@@ -2,6 +2,8 @@ module Konacha
class Engine < Rails::Engine
config.konacha = ActiveSupport::OrderedOptions.new
+ isolate_namespace Konacha
+
def self.application(app)
Rack::Builder.app do
map app.config.assets.prefix do
@@ -28,5 +30,13 @@ def self.application(app)
app.config.assets.paths << app.root.join(options.spec_dir).to_s
end
+
+ initializer "konacha.engine.mount" do
+ config.after_initialize do
+ ::Rails.application.routes.prepend do
+ mount ::Konacha::Engine => "/konacha"
+ end
+ end
+ end
end
end