dynamic_error_pages 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1dbb0f7e96a31cde85433075d21a74103ce8d32f
4
- data.tar.gz: a8aec31c508b05dbf70364ac5ac6ad0a3b8cbcbe
3
+ metadata.gz: 45a97320da48fe28a0802c9d68327d321009ccb5
4
+ data.tar.gz: 4d25552cdd814ebb289413f9f5c4adb553c4417d
5
5
  SHA512:
6
- metadata.gz: eb59a800baa72079b1c3b08a6a7551810d3609f13acf1762596abbac562740053f84b6424b3b5d1115add8831d0734d9fbcb32ce87d1087ba8168757e0e46dae
7
- data.tar.gz: 67f7ab1b9a3307b8378ba59b82e75fb09d7fb66e88b3546d29c83bd9882844a392798bf7474167faa8566974a2d65ccd3a9b9eb80aee44e9d7d1f21bde9d69b2
6
+ metadata.gz: 024aeadca90cf9e1c34c661645c1f47ef569e9977b3fe98b83e464458beaad6d0801c6d6cca9b6c3ff6422ab285306e73f2bb43762aa78e554d4208980088e09
7
+ data.tar.gz: d4e95d95cd8a6473fae1df2a48b923e1dca04fc8cd03412e464c81b1d667a9499b19faa7eb0930e0b9f5d9e402ee70b7fed84ed8bc84807c7375dbb6798371bc
@@ -1,6 +1,7 @@
1
1
  class DynamicErrorPages::ErrorsController < ApplicationController
2
2
 
3
3
  def show
4
+ request.format = :html
4
5
  begin
5
6
  render "#{status_code}", :status => status_code, :formats => [:html]
6
7
  rescue ActionView::MissingTemplate => e
@@ -19,8 +20,4 @@ class DynamicErrorPages::ErrorsController < ApplicationController
19
20
  request.path[1..-1]
20
21
  end
21
22
 
22
- def exception
23
- env['action_dispatch.exception']
24
- end
25
-
26
23
  end
data/config/routes.rb CHANGED
@@ -3,5 +3,8 @@ Rails.application.routes.draw do
3
3
  # rails 4 need the :via option
4
4
  via = Rails::VERSION::MAJOR > 3 ? {:via => :all} : {}
5
5
 
6
- match '/:status', {:to => "dynamic_error_pages/errors#show", :constraints => { :status => /\d{3}/ }}.merge(via)
6
+ # if a subclassed errorscontroller exist, route to it
7
+ controller = defined?(DynamicErrorPages::PatchedErrorsController) ? 'patched_errors' : 'errors'
8
+
9
+ match '/:status', {:to => "dynamic_error_pages/#{controller}#show", :constraints => { :status => /\d{3}/ }}.merge(via)
7
10
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /home/marcus/Work/repos/github/dynamic_error_pages
3
3
  specs:
4
- dynamic_error_pages (0.0.1)
4
+ dynamic_error_pages (0.0.2)
5
5
  rails (>= 3.2.0, <= 4.1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /home/marcus/Work/repos/github/dynamic_error_pages
3
3
  specs:
4
- dynamic_error_pages (0.0.1)
4
+ dynamic_error_pages (0.0.2)
5
5
  rails (>= 3.2.0, <= 4.1)
6
6
 
7
7
  GEM
@@ -1,8 +1,10 @@
1
+ require "rails"
2
+
1
3
  module DynamicErrorPages
2
4
  class Engine < ::Rails::Engine
5
+ engine_name :dynamic_error_pages
3
6
 
4
7
  initializer 'dynamic_error_pages.update_app' do |app|
5
- engine_name :dynamic_error_pages
6
8
  app.config.exceptions_app = app.routes
7
9
  end
8
10
 
@@ -1,3 +1,3 @@
1
1
  module DynamicErrorPages
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_error_pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Geißler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-01 00:00:00.000000000 Z
11
+ date: 2013-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler