Sha256: 1852c2d1ffb59304e750eeb874a6fb7f8369f02455143d54249e622db06e4fc0

Contents?: true

Size: 499 Bytes

Versions: 26

Compression:

Stored size: 499 Bytes

Contents

module StaticMatic::RescueMixin
  # Pass back an error template for the given exception
  def render_rescue_from_error(exception)
    rescue_template     = (exception.is_a?(StaticMatic::TemplateError)) ? "template" : "default"
      
    error_template_path = File.expand_path(File.dirname(__FILE__) + "/../templates/rescues/#{rescue_template}.haml")
    
    @scope.instance_variable_set("@exception", exception)
    
    generate_html_from_template_source(File.read(error_template_path))
  end
end

Version data entries

26 entries across 26 versions & 4 rubygems

Version Path
bdimcheff-staticmatic-0.10.1 lib/staticmatic/mixins/rescue.rb
mattt-staticmatic-0.10.1 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.0.2 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.0.1 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.0.0 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.1 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.10 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.9 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.8 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.7 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.6 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.5 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.4 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.3 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.1 lib/staticmatic/mixins/rescue.rb
staticmatic-0.11.0.alpha.0 lib/staticmatic/mixins/rescue.rb
staticmatic-0.10.8 lib/staticmatic/mixins/rescue.rb
staticmatic-0.10.7 lib/staticmatic/mixins/rescue.rb
staticmatic-0.10.6 lib/staticmatic/mixins/rescue.rb