lib/nitro/dispatcher.rb in nitro-0.26.0 vs lib/nitro/dispatcher.rb in nitro-0.27.0
- old
+ new
@@ -1,8 +1,9 @@
require 'nano/kernel/singleton'
require 'nitro/controller'
+require 'nitro/compiler'
require 'nitro/routing'
require 'nitro/helper/default'
module Nitro
@@ -197,11 +198,11 @@
parts.slice!(0, idx + 1)
else
#--
# FIXME: no raise to make testable.
#++
- raise NoActionError, "No action to dispatch to on #{klass}"
+ raise NoActionError, "No action for path '#{path}' on '#{klass}'"
end
# push any remaining parts of the url onto the query
# string for use with request
@@ -221,10 +222,11 @@
# Also handles reloading of controllers.
def controller_class_for(key)
klass = @controllers[key]
- if klass and Compiler.reload
+ if $autoreload_dirty and klass and Compiler.reload
+ Logger.info "Reloading controller '#{klass}'"
klass.instance_methods.grep(/(_action$)|(_template$)/).each do |m|
klass.send(:remove_method, m) rescue nil
end
klass.compile_scaffolding_code if klass.respond_to?(:compile_scaffolding_code)
end