rack-http_cat 1.0.0
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 +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +33 -0
- data/Rakefile +1 -0
- data/config.ru +6 -0
- data/lib/rack/http_cat.rb +17 -0
- data/rack-http_cat.gemspec +25 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b60869a8996e1e216804cb1c4adfaf4274d05f6c
|
4
|
+
data.tar.gz: 179db4a04852032d34071ec25031119611cc42e5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3be28c6bb46e347cd9225f5df30c9a41bc9594dc48a39151e316444a9f02aa024ab52a3842d7c8fd530989cd96adf4f72d3abcf574235273c2df5a0b41e76cb9
|
7
|
+
data.tar.gz: 8244ba812a232f2eb611efee2d2ec311a0e9a7f38b8c89ec4dc88cb51984bbecde5753fc46b5c5ba8477e5b5dd35d26fd492f4b72abb92a420e814d7addff5f0
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Rack::HTTPCat
|
2
|
+
|
3
|
+
Adds an easter-egg link to a status cat in the headers of your Rack application.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add to your Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rack-http_cat'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```sh
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it globally as:
|
20
|
+
|
21
|
+
```sh
|
22
|
+
$ gem install rack-http_cat
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
`require 'rack/http_cat'` and `use Rack::HTTPCat` in your config.ru (or whatever your application's entry point is).
|
28
|
+
|
29
|
+
You should see something like `HTTP-Cat: https://http.cat/200` in the headers of a successful page load.
|
30
|
+
|
31
|
+
## Notes
|
32
|
+
|
33
|
+
Without configuration Rack will handle 500 errors outside of your app and inside Rack itself, so you won't see a cat in your headers.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/config.ru
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Rack
|
2
|
+
class HTTPCat
|
3
|
+
|
4
|
+
VERSION = "1.0.0"
|
5
|
+
|
6
|
+
def initialize(app)
|
7
|
+
@app = app
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(env)
|
11
|
+
status, headers, response = @app.call(env)
|
12
|
+
headers["HTTP-Cat"] = "https://http.cat/#{status}"
|
13
|
+
[status, headers, response]
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rack/http_cat'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rack-http_cat"
|
8
|
+
spec.version = Rack::HTTPCat::VERSION
|
9
|
+
spec.authors = ["Chris Keele"]
|
10
|
+
spec.email = ["dev@chriskeele.com"]
|
11
|
+
|
12
|
+
spec.summary = "Adds an easter-egg link to a status cat in the headers of your Rack application."
|
13
|
+
spec.description = "Just use Rack::HTTPCat in your application for all requests to have a link to the https://http.cat for their status under the HTTP-Cat header."
|
14
|
+
spec.homepage = "https://github.com/christhekeele/rack-http_cat"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
|
24
|
+
spec.add_runtime_dependency "rack"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rack-http_cat
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Keele
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-07 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.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rack
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Just use Rack::HTTPCat in your application for all requests to have a
|
56
|
+
link to the https://http.cat for their status under the HTTP-Cat header.
|
57
|
+
email:
|
58
|
+
- dev@chriskeele.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- config.ru
|
69
|
+
- lib/rack/http_cat.rb
|
70
|
+
- rack-http_cat.gemspec
|
71
|
+
homepage: https://github.com/christhekeele/rack-http_cat
|
72
|
+
licenses: []
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.2.2
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Adds an easter-egg link to a status cat in the headers of your Rack application.
|
94
|
+
test_files: []
|
95
|
+
has_rdoc:
|