sixarm_ruby_http_status_codes 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +1 -0
- data/.gemtest +0 -0
- data/README.md +100 -0
- data/Rakefile +8 -0
- data/VERSION +1 -0
- data/lib/sixarm_ruby_http_status_codes.rb +87 -0
- data/test/sixarm_ruby_http_status_codes_test.rb +22 -0
- metadata +91 -0
- metadata.gz.sig +0 -0
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
+/�:0�p�%Y����🪄�R����h�A��Bj��GNa���:U:��6i�l�UU/�>�k�>������~Ԯ�g�-����Q�T����gT�(W`�ik��;c�^�jM�J����w
|
data/.gemtest
ADDED
File without changes
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# SixArm.com » Ruby » <br> HTTP Status Codes
|
2
|
+
|
3
|
+
* Doc: <http://sixarm.com/sixarm_ruby_http_status_codes/doc>
|
4
|
+
* Gem: <http://rubygems.org/gems/sixarm_ruby_http_status_codes>
|
5
|
+
* Repo: <http://github.com/sixarm/sixarm_ruby_http_status_codes>
|
6
|
+
* Email: Joel Parker Henderson, <joel@sixarm.com>
|
7
|
+
|
8
|
+
|
9
|
+
## Introduction
|
10
|
+
|
11
|
+
HTTP status codes as nicknames.
|
12
|
+
|
13
|
+
Examples:
|
14
|
+
|
15
|
+
Net::HTTP::Status::OK #=> 200
|
16
|
+
Net::HTTP::Status::NOT_FOUND #=> 404
|
17
|
+
|
18
|
+
|
19
|
+
For docs go to <http://sixarm.com/sixarm_ruby_http_status_codes/doc>
|
20
|
+
|
21
|
+
Want to help? We're happy to get pull requests.
|
22
|
+
|
23
|
+
|
24
|
+
## Install quickstart
|
25
|
+
|
26
|
+
Install:
|
27
|
+
|
28
|
+
gem install sixarm_ruby_http_status_codes
|
29
|
+
|
30
|
+
Bundler:
|
31
|
+
|
32
|
+
gem "sixarm_ruby_http_status_codes", "~>1.1.0"
|
33
|
+
|
34
|
+
Require:
|
35
|
+
|
36
|
+
require "sixarm_ruby_http_status_codes"
|
37
|
+
|
38
|
+
|
39
|
+
## Install with security (optional)
|
40
|
+
|
41
|
+
To enable high security for all our gems:
|
42
|
+
|
43
|
+
wget http://sixarm.com/sixarm.pem
|
44
|
+
gem cert --add sixarm.pem
|
45
|
+
gem sources --add http://sixarm.com
|
46
|
+
|
47
|
+
To install with high security:
|
48
|
+
|
49
|
+
gem install sixarm_ruby_http_status_codes --test --trust-policy HighSecurity
|
50
|
+
|
51
|
+
|
52
|
+
## Why?
|
53
|
+
|
54
|
+
Why use these instead of just using a number? Because we prefer using nicknames that are easy.
|
55
|
+
|
56
|
+
Why use these instead of the codes that already exist in other libraries, like Ruby Net::HTTP, Rack Utils, and Rails ActionPack? Because we want WebDAV codes (e.g. 403 means a resource is locked) and informal convention codes (e.g. 599 means a network connect timeout).
|
57
|
+
|
58
|
+
|
59
|
+
## See Also
|
60
|
+
|
61
|
+
To see similar codes:
|
62
|
+
|
63
|
+
* Ruby Net HTTP library
|
64
|
+
* Rack Utils
|
65
|
+
* Rails ActionPack
|
66
|
+
|
67
|
+
|
68
|
+
## Changes
|
69
|
+
|
70
|
+
* 2012-03-24 1.1.0 Upgrade for Ruby 1.9.3, minitest/spec, and improved docs.
|
71
|
+
* 2011-10-22 1.0.3 Add IETF draft-nottingham-http-new-status-02
|
72
|
+
* 2011-10-06 1.0.2 Publish
|
73
|
+
|
74
|
+
## License
|
75
|
+
|
76
|
+
You may choose any of these open source licenses:
|
77
|
+
|
78
|
+
* Apache License
|
79
|
+
* BSD License
|
80
|
+
* CreativeCommons License, Non-commercial Share Alike
|
81
|
+
* GNU General Public License Version 2 (GPL 2)
|
82
|
+
* GNU Lesser General Public License (LGPL)
|
83
|
+
* MIT License
|
84
|
+
* Perl Artistic License
|
85
|
+
* Ruby License
|
86
|
+
|
87
|
+
The software is provided "as is", without warranty of any kind,
|
88
|
+
express or implied, including but not limited to the warranties of
|
89
|
+
merchantability, fitness for a particular purpose and noninfringement.
|
90
|
+
|
91
|
+
In no event shall the authors or copyright holders be liable for any
|
92
|
+
claim, damages or other liability, whether in an action of contract,
|
93
|
+
tort or otherwise, arising from, out of or in connection with the
|
94
|
+
software or the use or other dealings in the software.
|
95
|
+
|
96
|
+
This license is for the included software that is created by SixArm;
|
97
|
+
some of the included software may have its own licenses, copyrights,
|
98
|
+
authors, etc. and these do take precedence over the SixArm license.
|
99
|
+
|
100
|
+
Copyright (c) 2005-2013 Joel Parker Henderson
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.1.0
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin rdoc
|
3
|
+
Please see README
|
4
|
+
=end
|
5
|
+
|
6
|
+
module Net
|
7
|
+
module HTTP
|
8
|
+
module Status
|
9
|
+
CONTINUE = 100
|
10
|
+
SWITCHING_PROTOCOLS = 101
|
11
|
+
PROCESSING = 102 # WebDAV (RFC 2518)
|
12
|
+
CHECKPOINT = 103
|
13
|
+
REQUEST_URI_TOO_LONG_NONSTANDARD_MSIE_ONLY = 122
|
14
|
+
OK = 200
|
15
|
+
CREATED = 201
|
16
|
+
ACCEPTED = 202
|
17
|
+
NON_AUTHORITATIVE_INFORMATION = 203 # Since HTTP/1.1
|
18
|
+
NO_CONTENT = 204
|
19
|
+
RESET_CONTENT = 205
|
20
|
+
PARTIAL_CONTENT = 206
|
21
|
+
MULTI_STATUS = 207 # WebDAV (RFC 4918)
|
22
|
+
IM_USED = 226 # RFC 3229
|
23
|
+
MULTIPLE_CHOICES = 300
|
24
|
+
MOVED_PERMANENTLY = 301
|
25
|
+
FOUND = 302
|
26
|
+
SEE_OTHER = 303 # Since HTTP/1.1
|
27
|
+
NOT_MODIFIED = 304
|
28
|
+
USE_PROXY = 305 # Since HTTP/1.1
|
29
|
+
SWITCH_PROXY = 306
|
30
|
+
TEMPORARY_REDIRECT = 307 # Since HTTP/1.1
|
31
|
+
RESUME_INCOMPLETE = 308
|
32
|
+
BAD_REQUEST = 400
|
33
|
+
UNAUTHORIZED = 401
|
34
|
+
PAYMENT_REQUIRED = 402
|
35
|
+
FORBIDDEN = 403
|
36
|
+
NOT_FOUND = 404
|
37
|
+
METHOD_NOT_ALLOWED = 405
|
38
|
+
NOT_ACCEPTABLE = 406
|
39
|
+
PROXY_AUTHENTICATION_REQUIRED = 407
|
40
|
+
REQUEST_TIMEOUT = 408
|
41
|
+
CONFLICT = 409
|
42
|
+
GONE = 410
|
43
|
+
LENGTH_REQUIRED = 411
|
44
|
+
PRECONDITION_FAILED = 412
|
45
|
+
REQUEST_ENTITY_TOO_LARGE = 413
|
46
|
+
REQUEST_URI_TOO_LONG = 414
|
47
|
+
UNSUPPORTED_MEDIA_TYPE = 415
|
48
|
+
REQUESTED_RANGE_NOT_SATISFIABLE = 416
|
49
|
+
EXPECTATION_FAILED = 417
|
50
|
+
IM_A_TEAPOT = 418 # RFC 2324
|
51
|
+
UNPROCESSABLE_ENTITY = 422 # WebDAV (RFC 4918)
|
52
|
+
LOCKED = 423 # WebDAV (RFC 4918)
|
53
|
+
FAILED_DEPENDENCY = 424 # WebDAV (RFC 4918)
|
54
|
+
UNORDERED_COLLECTION = 425 # RFC 3648
|
55
|
+
UPGRADE_REQUIRED = 426 # RFC 2817
|
56
|
+
PRECONDITION_REQUIRED = 428 # IETF draft-nottingham-http-new-status-02
|
57
|
+
TOO_MANY_REQUESTS = 429 # IETF draft-nottingham-http-new-status-02
|
58
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE = 439 # IETF draft-nottingham-http-new-status-02
|
59
|
+
NO_RESPONSE = 444
|
60
|
+
RETRY_WITH = 449
|
61
|
+
BLOCKED_BY_PARENTAL_CONTROLS = 450
|
62
|
+
CLIENT_CLOSED_REQUEST = 499
|
63
|
+
INTERNAL_SERVER_ERROR = 500
|
64
|
+
NOT_IMPLEMENTED = 501
|
65
|
+
BAD_GATEWAY = 502
|
66
|
+
SERVICE_UNAVAILABLE = 503
|
67
|
+
GATEWAY_TIMEOUT = 504
|
68
|
+
HTTP_VERSION_NOT_SUPPORTED = 505
|
69
|
+
VARIANT_ALSO_NEGOTIATES = 506 # RFC 2295
|
70
|
+
INSUFFICIENT_STORAGE = 507 # WebDAV (RFC 4918)
|
71
|
+
BANDWIDTH_LIMIT_EXCEEDED = 509 # Apace Limited Extension
|
72
|
+
NOT_EXTENDED = 510 # RFC 2774
|
73
|
+
NETWORK_AUTHENTICATION_REQUIRED = 511 # IETF draft-nottingham-http-new-status-02
|
74
|
+
NETWORK_READ_TIMEOUT = 598 # Informal convention
|
75
|
+
NETWORK_CONNECT_TIMEOUT = 599 # Informal convention
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.start
|
5
|
+
require 'sixarm_ruby_http_status_codes'
|
6
|
+
|
7
|
+
describe Net::HTTP::Status do
|
8
|
+
|
9
|
+
describe "fully qualified" do
|
10
|
+
|
11
|
+
it "Ok => 200" do
|
12
|
+
Net::HTTP::Status::OK.must_equal 200
|
13
|
+
end
|
14
|
+
|
15
|
+
it "Not Found => 404" do
|
16
|
+
Net::HTTP::Status::NOT_FOUND.must_equal 404
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sixarm_ruby_http_status_codes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- SixArm
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain:
|
12
|
+
- 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EETU5bHoMAwGA1UdEwQF
|
39
|
+
|
40
|
+
MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAooEexP/oPam1TP71SyuhxMb+uTrZbSQe
|
41
|
+
|
42
|
+
jVB+ExRwWadGwaNPUA56d39qwavwP+iu+3JpeonNMVvbWXF5naCX/dNFIeREHzER
|
43
|
+
|
44
|
+
ZDRQYMqru9TEMna6HD9zpcstF7vwThGovlOQ+3Y6plQ4nMzipXcZ9THqs65PIL0q
|
45
|
+
|
46
|
+
eabwpCbAopo=
|
47
|
+
|
48
|
+
-----END CERTIFICATE-----
|
49
|
+
|
50
|
+
'
|
51
|
+
date: 2012-03-25 00:00:00.000000000 Z
|
52
|
+
dependencies: []
|
53
|
+
description:
|
54
|
+
email: sixarm@sixarm.com
|
55
|
+
executables: []
|
56
|
+
extensions: []
|
57
|
+
extra_rdoc_files: []
|
58
|
+
files:
|
59
|
+
- .gemtest
|
60
|
+
- Rakefile
|
61
|
+
- README.md
|
62
|
+
- VERSION
|
63
|
+
- lib/sixarm_ruby_http_status_codes.rb
|
64
|
+
- test/sixarm_ruby_http_status_codes_test.rb
|
65
|
+
homepage: http://sixarm.com/
|
66
|
+
licenses: []
|
67
|
+
post_install_message:
|
68
|
+
rdoc_options: []
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
requirements: []
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 1.8.19
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: SixArm.com » Ruby » HTTP Status Codes
|
89
|
+
test_files:
|
90
|
+
- test/sixarm_ruby_http_status_codes_test.rb
|
91
|
+
has_rdoc: true
|
metadata.gz.sig
ADDED
Binary file
|