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
# File 'lib/roda/plugins/multi_run.rb', line 56

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.



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

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.



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

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