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.



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

def freeze
  opts[:multi_run_apps].freeze
  self::RodaRequest.refresh_multi_run_regexp!
  super
end

#multi_run_appsObject

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



64
65
66
# File 'lib/roda/plugins/multi_run.rb', line 64

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.



70
71
72
73
# File 'lib/roda/plugins/multi_run.rb', line 70

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