lib/jets/turbine.rb in jets-1.7.2 vs lib/jets/turbine.rb in jets-1.8.0

- old
+ new

@@ -1,7 +1,8 @@ module Jets class Turbine + class_attribute :after_initializers class_attribute :initializers class_attribute :on_exceptions class << self def subclasses @@ -10,10 +11,15 @@ def inherited(base) subclasses << base end + def after_initializer(label, &block) + self.after_initializers ||= {} + self.after_initializers[label] = block + end + def initializer(label, &block) self.initializers ||= {} self.initializers[label] = block end @@ -22,9 +28,14 @@ self.on_exceptions[label] = block end def exception_reporter(label, &block) on_exception(label, &block) + end + + # Make config available in Turbine. Note only available outside of hooks like initializers. + def config + Jets.application.config end end end end