errship3 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -1
- data/config/locales/en.yml +6 -4
- data/lib/generators/errship3/templates/standard.html.erb +14 -0
- data/lib/generators/errship3/view_generator.rb +17 -0
- metadata +21 -3
data/README.rdoc
CHANGED
@@ -19,16 +19,25 @@ You can also use the flashback method to set an error message and redirect :back
|
|
19
19
|
a RedirectBackError is raised, the user is dropped off at the nearest error page and given
|
20
20
|
the flash message anyway.
|
21
21
|
|
22
|
+
Now it will also support twitter bootstrap
|
23
|
+
|
22
24
|
== Installation
|
23
25
|
|
24
26
|
Add this to your Gemfile
|
25
|
-
gem 'errship3', '~> 3.0.
|
27
|
+
gem 'errship3', '~> 3.0.1'
|
26
28
|
|
27
29
|
Add this to your ApplicationController
|
28
30
|
class ApplicationController < ActionController::Base
|
29
31
|
include Errship3::Rescuers
|
30
32
|
include Errship3::ActiveRecord::Rescuers # or replace 'ActiveRecord' with MongoMapper, or Mongoid
|
31
33
|
|
34
|
+
You can generate the view file to customize yourself
|
35
|
+
rails g errship3:view
|
36
|
+
this will generate a view file on your app/views/errship3/standard.html.erb
|
37
|
+
|
38
|
+
You can customize it yourself.
|
39
|
+
|
40
|
+
|
32
41
|
Errship3 is ready to go! To test it out in development, you'll need to set
|
33
42
|
|
34
43
|
config.consider_all_requests_local = false
|
data/config/locales/en.yml
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
## line fix
|
2
|
+
#
|
1
3
|
en:
|
2
4
|
errship3:
|
3
5
|
'404':
|
4
|
-
title: 'This page does not
|
5
|
-
description: 'It could have moved, or someone (maybe you!) mistyped the URL.'
|
6
|
+
title: 'This page does not even exists'
|
7
|
+
description: 'Do not freak out, everything is going to be OK. It could have moved, or someone (maybe you!) mistyped the URL or some other horrible error has occurred. Can you please try again?'
|
6
8
|
'500':
|
7
|
-
title: '
|
8
|
-
description: 'This has been reported to our development team. Thank you!'
|
9
|
+
title: 'We have a problem!'
|
10
|
+
description: 'This has been reported to our development team. Thank you!'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% content_for :head do %>
|
2
|
+
<%= stylesheet_link_tag 'errship3', :media => 'screen, projection' %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<div class='errship3'>
|
6
|
+
<h1 class='error_code alert'><%= status_code %></h1>
|
7
|
+
<% if errship3_scope %>
|
8
|
+
<h2><%= t "errship3.#{status_code}.#{errship3_scope}.title" %></h2>
|
9
|
+
<p><%= t "errship3.#{status_code}.#{errship3_scope}.description" %></p>
|
10
|
+
<% else %>
|
11
|
+
<h2><%= t "errship3.#{status_code}.title" %></h2>
|
12
|
+
<p><%= t "errship3.#{status_code}.description" %></p>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
module Errship3
|
3
|
+
class ViewGenerator < Rails::Generators::Base
|
4
|
+
desc "Generator Your View To Customize"
|
5
|
+
class_option :my_opt, :type => :boolean, :default => false, :desc => "My Option"
|
6
|
+
|
7
|
+
def self.source_root
|
8
|
+
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
|
9
|
+
end
|
10
|
+
|
11
|
+
def copy_initializer
|
12
|
+
copy_file '../templates/standard.html.erb',
|
13
|
+
'app/views/errship3/standard.html.erb'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: errship3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-12-
|
15
|
+
date: 2012-12-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|
@@ -78,6 +78,22 @@ dependencies:
|
|
78
78
|
- - ! '>='
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 1.6.0
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rails
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - '='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 3.2.9
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.2.9
|
81
97
|
description: Errship3 is a Rails 3.2 engine for rendering error pages inside your
|
82
98
|
layout. It supports i18n, custom exceptions, and Airbrake (Hoptoad) error tracking.
|
83
99
|
email:
|
@@ -97,6 +113,8 @@ files:
|
|
97
113
|
- config/locales/en.yml
|
98
114
|
- config/routes.rb
|
99
115
|
- lib/errship3.rb
|
116
|
+
- lib/generators/errship3/templates/standard.html.erb
|
117
|
+
- lib/generators/errship3/view_generator.rb
|
100
118
|
- lib/rescuers/active_record.rb
|
101
119
|
- lib/rescuers/mongo_mapper.rb
|
102
120
|
- lib/rescuers/mongoid.rb
|
@@ -117,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
135
|
version: '0'
|
118
136
|
segments:
|
119
137
|
- 0
|
120
|
-
hash:
|
138
|
+
hash: 826767499488905832
|
121
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
140
|
none: false
|
123
141
|
requirements:
|