Module: Roda::RodaPlugins::MultiRun::ClassMethods

Defined in:
lib/roda/plugins/multi_run.rb

Instance Method Summary collapse

Instance Method Details

#freezeObject

Freeze the multi_run apps so that there can be no thread safety issues at runtime.



42
43
44
45
# File 'lib/roda/plugins/multi_run.rb', line 42

def freeze
  opts[:multi_run_apps].freeze
  super
end

#multi_run_appsObject

Hash storing rack applications to dispatch to, keyed by the prefix for the application.



49
50
51
# File 'lib/roda/plugins/multi_run.rb', line 49

def multi_run_apps
  opts[:multi_run_apps]
end

#run(prefix, app) ⇒ Object

Add a rack application to dispatch to for the given prefix when r.multi_run is called.



55
56
57
58
# File 'lib/roda/plugins/multi_run.rb', line 55

def run(prefix, app)
  multi_run_apps[prefix.to_s] = app
  self::RodaRequest.refresh_multi_run_regexp!
end