Sha256: ec7e615c35eba6650e00e8593406bd7d165bb6bf799131ecfc50eb10248b4182
Contents?: true
Size: 633 Bytes
Versions: 10
Compression:
Stored size: 633 Bytes
Contents
module Happy module Extras class CodeReloader < Happy::Controller class << self def reload_app_code Dir[config[:directory]].each do |f| load f end @app_code_loaded = true end def reload_app_code? Happy.env.development? || !@app_code_loaded end end def route raise "no directory specified" unless config[:directory] raise "no controller specified" unless config[:controller] self.class.reload_app_code if self.class.reload_app_code? run eval(config[:controller]) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems