Sha256: 808cf3aa514d6b116e0ca9b15673909a73c60d7e0affe103909006222e4af272
Contents?: true
Size: 607 Bytes
Versions: 1
Compression:
Stored size: 607 Bytes
Contents
module Happy module Utils class AppSpawner attr_reader :options def initialize(options = {}) @options = { :scripts => './app/*.rb' }.merge(options) end def call(env) app.call(env) end def app @app = reload_app? ? load_app : @app end def load_app Happy::Controller.build.tap do |klass| Dir[options[:scripts]].each do |file| klass.instance_eval File.read(file) end end end def reload_app? !Happy.env.production? end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
happy-0.1.0.pre7 | lib/happy/utils/app_spawner.rb |