lib/grape/reload/grape_api.rb in grape-reload-0.0.2 vs lib/grape/reload/grape_api.rb in grape-reload-0.0.3

- old
+ new

@@ -15,11 +15,11 @@ CLASS end end def initialize(app) - @app_klass = app.to_s + @app_klass = app end def call(*args) if reload_threshold && (Time.now > (@last || reload_threshold.ago) + 1) Thread.list.size > 1 ? Thread.exclusive { Grape::Reload::Watcher.reload! } : Grape::Reload::Watcher.reload! @@ -46,14 +46,19 @@ end def reinit! declaration = class_declaration.dup @class_decl = [] + endpoints.each { |e| e.options[:app].reinit! if e.options[:app] } reset! declaration.each {|decl| send(decl[0],*deep_reconstantize.call(decl[1]),&decl[2]) } change! + end + + def recursive_! + end private def class_declaration @class_decl ||= [] end \ No newline at end of file