http_error_cats 0.0.1
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 +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +25 -0
- data/README.md +48 -0
- data/Rakefile +2 -0
- data/app/controllers/http_error_cats/errors_controller.rb +18 -0
- data/config/routes.rb +3 -0
- data/http_error_cats.gemspec +24 -0
- data/lib/assets/images/http_error_cats/100.jpg +0 -0
- data/lib/assets/images/http_error_cats/101.jpg +0 -0
- data/lib/assets/images/http_error_cats/200.jpg +0 -0
- data/lib/assets/images/http_error_cats/201.jpg +0 -0
- data/lib/assets/images/http_error_cats/202.jpg +0 -0
- data/lib/assets/images/http_error_cats/204.jpg +0 -0
- data/lib/assets/images/http_error_cats/206.jpg +0 -0
- data/lib/assets/images/http_error_cats/207.jpg +0 -0
- data/lib/assets/images/http_error_cats/300.jpg +0 -0
- data/lib/assets/images/http_error_cats/301.jpg +0 -0
- data/lib/assets/images/http_error_cats/302.jpg +0 -0
- data/lib/assets/images/http_error_cats/303.jpg +0 -0
- data/lib/assets/images/http_error_cats/304.jpg +0 -0
- data/lib/assets/images/http_error_cats/305.jpg +0 -0
- data/lib/assets/images/http_error_cats/307.jpg +0 -0
- data/lib/assets/images/http_error_cats/400.jpg +0 -0
- data/lib/assets/images/http_error_cats/401.jpg +0 -0
- data/lib/assets/images/http_error_cats/402.jpg +0 -0
- data/lib/assets/images/http_error_cats/403.jpg +0 -0
- data/lib/assets/images/http_error_cats/404.jpg +0 -0
- data/lib/assets/images/http_error_cats/405.jpg +0 -0
- data/lib/assets/images/http_error_cats/406.jpg +0 -0
- data/lib/assets/images/http_error_cats/408.jpg +0 -0
- data/lib/assets/images/http_error_cats/409.jpg +0 -0
- data/lib/assets/images/http_error_cats/410.jpg +0 -0
- data/lib/assets/images/http_error_cats/411.jpg +0 -0
- data/lib/assets/images/http_error_cats/413.jpg +0 -0
- data/lib/assets/images/http_error_cats/414.jpg +0 -0
- data/lib/assets/images/http_error_cats/416.jpg +0 -0
- data/lib/assets/images/http_error_cats/417.jpg +0 -0
- data/lib/assets/images/http_error_cats/418.jpg +0 -0
- data/lib/assets/images/http_error_cats/422.jpg +0 -0
- data/lib/assets/images/http_error_cats/423.jpg +0 -0
- data/lib/assets/images/http_error_cats/424.jpg +0 -0
- data/lib/assets/images/http_error_cats/425.jpg +0 -0
- data/lib/assets/images/http_error_cats/426.jpg +0 -0
- data/lib/assets/images/http_error_cats/429.jpg +0 -0
- data/lib/assets/images/http_error_cats/431.jpg +0 -0
- data/lib/assets/images/http_error_cats/444.jpg +0 -0
- data/lib/assets/images/http_error_cats/450.jpg +0 -0
- data/lib/assets/images/http_error_cats/451.jpg +0 -0
- data/lib/assets/images/http_error_cats/500.jpg +0 -0
- data/lib/assets/images/http_error_cats/502.jpg +0 -0
- data/lib/assets/images/http_error_cats/503.jpg +0 -0
- data/lib/assets/images/http_error_cats/506.jpg +0 -0
- data/lib/assets/images/http_error_cats/507.jpg +0 -0
- data/lib/assets/images/http_error_cats/508.jpg +0 -0
- data/lib/assets/images/http_error_cats/509.jpg +0 -0
- data/lib/assets/images/http_error_cats/599.jpg +0 -0
- data/lib/http_error_cats.rb +2 -0
- data/lib/http_error_cats/engine.rb +31 -0
- data/lib/http_error_cats/version.rb +3 -0
- metadata +146 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: d497c289140d062ffadea3b0fc0994175296d2af
|
|
4
|
+
data.tar.gz: d9a5263e8f6dca3e21051de4d141b1404196fd14
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 2e5ddfc49ef4de95f49310deef3fa14ed86e7584b90613148387b6900fa7f13709ee625a2b08144e547f24b3fb45ac200281a0fa73b1599bf6996806997245cf
|
|
7
|
+
data.tar.gz: 9262de1d68ddf066953933e2e003b22c056a72221bca90a987fbee6cafd0e87963cebe5f12cab80b61846c8067d4fb2e1e118c4f4c5f59167ba0265de2c7fcba
|
data/.gitignore
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
.bundle
|
|
4
|
+
.config
|
|
5
|
+
.yardoc
|
|
6
|
+
Gemfile.lock
|
|
7
|
+
InstalledFiles
|
|
8
|
+
_yardoc
|
|
9
|
+
coverage
|
|
10
|
+
doc/
|
|
11
|
+
lib/bundler/man
|
|
12
|
+
pkg
|
|
13
|
+
rdoc
|
|
14
|
+
spec/reports
|
|
15
|
+
test/tmp
|
|
16
|
+
test/version_tmp
|
|
17
|
+
tmp
|
|
18
|
+
*.bundle
|
|
19
|
+
*.so
|
|
20
|
+
*.o
|
|
21
|
+
*.a
|
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Copyright (c) 2014 Michael Sprauer
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
Images (c) girliemac
|
|
25
|
+
https://www.flickr.com/photos/girliemac/
|
data/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# HttpErrorCats
|
|
2
|
+
|
|
3
|
+
Replace your HTTP error codes with cats As seen here https://www.flickr.com/photos/girliemac/sets/72157628409467125/
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'http_error_cats'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install http_error_cats
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Configuration options in `config/application.rb`
|
|
22
|
+
|
|
23
|
+
# Layout to use for error page rendering. Default: false
|
|
24
|
+
HttpErrorCats.layout = false
|
|
25
|
+
|
|
26
|
+
# Cat codes to server. Default :all
|
|
27
|
+
HttpErrorCats.codes = :all
|
|
28
|
+
# or
|
|
29
|
+
HttpErrorCats.codes = [404, 500]
|
|
30
|
+
|
|
31
|
+
# Html used to render the error code.
|
|
32
|
+
# Default:
|
|
33
|
+
# Proc.new do |status_code|
|
|
34
|
+
# image_tag "/assets/http_error_cats/#{status_code}.jpg", alt: "Status code #{status_code}"
|
|
35
|
+
# end
|
|
36
|
+
HttpErrorCats.html = Proc.new {|code| "<h2>Error #{code}</h2>"}
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
Images (c) girlimac - https://www.flickr.com/photos/girliemac/
|
|
41
|
+
|
|
42
|
+
## Contributing
|
|
43
|
+
|
|
44
|
+
1. Fork it ( https://github.com/[my-github-username]/http_error_cats/fork )
|
|
45
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
46
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
47
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
48
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require "http_error_cats"
|
|
2
|
+
|
|
3
|
+
module HttpErrorCats
|
|
4
|
+
class ErrorsController < ::ApplicationController
|
|
5
|
+
|
|
6
|
+
def show
|
|
7
|
+
return unless HttpErrorCats.codes == :all
|
|
8
|
+
return if HttpErrorCats.codes.is_a?(Array) && !HttpErrorCats.codes.include?(status_code)
|
|
9
|
+
html = HttpErrorCats.html
|
|
10
|
+
html = html.call status_code if html.is_a?(Proc)
|
|
11
|
+
render inline: html, layout: HttpErrorCats.layout
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def status_code
|
|
15
|
+
params[:code] || 500
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'http_error_cats/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "http_error_cats"
|
|
8
|
+
spec.version = HttpErrorCats::VERSION
|
|
9
|
+
spec.authors = ["Michael Sprauer"]
|
|
10
|
+
spec.email = ["Sprauer@Inline.de"]
|
|
11
|
+
spec.summary = %q{Replace your HTTP error codes with cats}
|
|
12
|
+
spec.description = %q{As seen here https://www.flickr.com/photos/girliemac/sets/72157628409467125/}
|
|
13
|
+
spec.homepage = "https://www.flickr.com/photos/girliemac/sets/72157628409467125/"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
|
22
|
+
spec.add_development_dependency 'rake'
|
|
23
|
+
spec.add_dependency 'rails', '~> 4'
|
|
24
|
+
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require 'rails/engine'
|
|
2
|
+
require 'action_view/helpers/asset_tag_helper'
|
|
3
|
+
|
|
4
|
+
module HttpErrorCats
|
|
5
|
+
class Engine < Rails::Engine
|
|
6
|
+
initializer 'http_error_cats.load_static_assets' do |app|
|
|
7
|
+
app.config.assets.precompile += %w(*.jpg)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
extend ActionView::Helpers::AssetTagHelper
|
|
13
|
+
extend ActionView::Helpers::TagHelper
|
|
14
|
+
|
|
15
|
+
mattr_accessor :layout, :codes, :html
|
|
16
|
+
|
|
17
|
+
def self.layout
|
|
18
|
+
@@layout || false
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.codes
|
|
22
|
+
@@codes || :all
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.html
|
|
26
|
+
@@html || Proc.new do |status_code|
|
|
27
|
+
image_tag "/assets/http_error_cats/#{status_code}.jpg", alt: "Status code #{status_code}"
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: http_error_cats
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Michael Sprauer
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2014-04-16 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.6'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.6'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rails
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '4'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '4'
|
|
55
|
+
description: As seen here https://www.flickr.com/photos/girliemac/sets/72157628409467125/
|
|
56
|
+
email:
|
|
57
|
+
- Sprauer@Inline.de
|
|
58
|
+
executables: []
|
|
59
|
+
extensions: []
|
|
60
|
+
extra_rdoc_files: []
|
|
61
|
+
files:
|
|
62
|
+
- ".gitignore"
|
|
63
|
+
- Gemfile
|
|
64
|
+
- LICENSE.txt
|
|
65
|
+
- README.md
|
|
66
|
+
- Rakefile
|
|
67
|
+
- app/controllers/http_error_cats/errors_controller.rb
|
|
68
|
+
- config/routes.rb
|
|
69
|
+
- http_error_cats.gemspec
|
|
70
|
+
- lib/assets/images/http_error_cats/100.jpg
|
|
71
|
+
- lib/assets/images/http_error_cats/101.jpg
|
|
72
|
+
- lib/assets/images/http_error_cats/200.jpg
|
|
73
|
+
- lib/assets/images/http_error_cats/201.jpg
|
|
74
|
+
- lib/assets/images/http_error_cats/202.jpg
|
|
75
|
+
- lib/assets/images/http_error_cats/204.jpg
|
|
76
|
+
- lib/assets/images/http_error_cats/206.jpg
|
|
77
|
+
- lib/assets/images/http_error_cats/207.jpg
|
|
78
|
+
- lib/assets/images/http_error_cats/300.jpg
|
|
79
|
+
- lib/assets/images/http_error_cats/301.jpg
|
|
80
|
+
- lib/assets/images/http_error_cats/302.jpg
|
|
81
|
+
- lib/assets/images/http_error_cats/303.jpg
|
|
82
|
+
- lib/assets/images/http_error_cats/304.jpg
|
|
83
|
+
- lib/assets/images/http_error_cats/305.jpg
|
|
84
|
+
- lib/assets/images/http_error_cats/307.jpg
|
|
85
|
+
- lib/assets/images/http_error_cats/400.jpg
|
|
86
|
+
- lib/assets/images/http_error_cats/401.jpg
|
|
87
|
+
- lib/assets/images/http_error_cats/402.jpg
|
|
88
|
+
- lib/assets/images/http_error_cats/403.jpg
|
|
89
|
+
- lib/assets/images/http_error_cats/404.jpg
|
|
90
|
+
- lib/assets/images/http_error_cats/405.jpg
|
|
91
|
+
- lib/assets/images/http_error_cats/406.jpg
|
|
92
|
+
- lib/assets/images/http_error_cats/408.jpg
|
|
93
|
+
- lib/assets/images/http_error_cats/409.jpg
|
|
94
|
+
- lib/assets/images/http_error_cats/410.jpg
|
|
95
|
+
- lib/assets/images/http_error_cats/411.jpg
|
|
96
|
+
- lib/assets/images/http_error_cats/413.jpg
|
|
97
|
+
- lib/assets/images/http_error_cats/414.jpg
|
|
98
|
+
- lib/assets/images/http_error_cats/416.jpg
|
|
99
|
+
- lib/assets/images/http_error_cats/417.jpg
|
|
100
|
+
- lib/assets/images/http_error_cats/418.jpg
|
|
101
|
+
- lib/assets/images/http_error_cats/422.jpg
|
|
102
|
+
- lib/assets/images/http_error_cats/423.jpg
|
|
103
|
+
- lib/assets/images/http_error_cats/424.jpg
|
|
104
|
+
- lib/assets/images/http_error_cats/425.jpg
|
|
105
|
+
- lib/assets/images/http_error_cats/426.jpg
|
|
106
|
+
- lib/assets/images/http_error_cats/429.jpg
|
|
107
|
+
- lib/assets/images/http_error_cats/431.jpg
|
|
108
|
+
- lib/assets/images/http_error_cats/444.jpg
|
|
109
|
+
- lib/assets/images/http_error_cats/450.jpg
|
|
110
|
+
- lib/assets/images/http_error_cats/451.jpg
|
|
111
|
+
- lib/assets/images/http_error_cats/500.jpg
|
|
112
|
+
- lib/assets/images/http_error_cats/502.jpg
|
|
113
|
+
- lib/assets/images/http_error_cats/503.jpg
|
|
114
|
+
- lib/assets/images/http_error_cats/506.jpg
|
|
115
|
+
- lib/assets/images/http_error_cats/507.jpg
|
|
116
|
+
- lib/assets/images/http_error_cats/508.jpg
|
|
117
|
+
- lib/assets/images/http_error_cats/509.jpg
|
|
118
|
+
- lib/assets/images/http_error_cats/599.jpg
|
|
119
|
+
- lib/http_error_cats.rb
|
|
120
|
+
- lib/http_error_cats/engine.rb
|
|
121
|
+
- lib/http_error_cats/version.rb
|
|
122
|
+
homepage: https://www.flickr.com/photos/girliemac/sets/72157628409467125/
|
|
123
|
+
licenses:
|
|
124
|
+
- MIT
|
|
125
|
+
metadata: {}
|
|
126
|
+
post_install_message:
|
|
127
|
+
rdoc_options: []
|
|
128
|
+
require_paths:
|
|
129
|
+
- lib
|
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
131
|
+
requirements:
|
|
132
|
+
- - ">="
|
|
133
|
+
- !ruby/object:Gem::Version
|
|
134
|
+
version: '0'
|
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
|
+
requirements:
|
|
137
|
+
- - ">="
|
|
138
|
+
- !ruby/object:Gem::Version
|
|
139
|
+
version: '0'
|
|
140
|
+
requirements: []
|
|
141
|
+
rubyforge_project:
|
|
142
|
+
rubygems_version: 2.2.2
|
|
143
|
+
signing_key:
|
|
144
|
+
specification_version: 4
|
|
145
|
+
summary: Replace your HTTP error codes with cats
|
|
146
|
+
test_files: []
|