response_code 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ee5e9a44623d499f56154fe4e29fb9d7cd694dc5c468f6236bc599c2cec981f8
4
+ data.tar.gz: a6c9d2dd370dee1b9f90fada6752181faa0b605789879abc23ae046b7434a801
5
+ SHA512:
6
+ metadata.gz: b3baf5f6d77a84ebb270234a353959f0320193b4a58c9d4010271a1eee95501a86cb4178b32be41d52bd6e450e100faf169a37ea78ed6e251770a05795723b46
7
+ data.tar.gz: f7d563400eb11fb1e3e66998d3706bdbe8f709fe53c52d553a8fa6705d02917cd45c5bc7d8bf3a48beac0c67da57def5de006f6a38ac4e81a3f3239ae1d97c01
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Márk Török
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # response_code
2
+ Response Code in readable way.
data/bin/response_code ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'response_code'
4
+
5
+ puts "Response code of OK is: #{ ResponseCode.ok }"
@@ -0,0 +1,66 @@
1
+ module ResponseCode
2
+ CODES={
3
+ continue: 100,
4
+ switching_protocols: 101,
5
+ processing: 102,
6
+
7
+ ok: 200,
8
+ created: 201,
9
+ accepted: 202,
10
+ non_authoritive_information: 203,
11
+ no_content: 204,
12
+ reset_content: 205,
13
+ partial_content: 206,
14
+ multi_status: 207,
15
+ already_reported: 208,
16
+ im_used: 226,
17
+
18
+ multiple_choices: 300,
19
+ moved_permanentaly: 301,
20
+ found: 302,
21
+ see_other: 303,
22
+ not_modified: 304,
23
+ use_proxy: 305,
24
+ temporary_redirect: 307,
25
+ permanent_redirect: 308,
26
+
27
+ bad_request: 400,
28
+ unauthorized: 401,
29
+ payment_required: 402,
30
+ forbidden: 403,
31
+ not_found: 404,
32
+ method_not_allowed: 405,
33
+ not_acceptable: 406,
34
+ proxy_authentication_required: 407,
35
+ request_timeout: 408,
36
+ conflict: 409,
37
+ gone: 410,
38
+ length_required: 411,
39
+ precondition_failed: 412,
40
+ payload_too_large: 413,
41
+ request_uri_too_long: 414,
42
+ unsupported_media_type: 415,
43
+ requested_range_not_satisfiable: 416,
44
+ expectation_failed: 417,
45
+ im_a_teapot: 418,
46
+ misdirected_request: 421,
47
+ unprocessable_entity: 422,
48
+ locked: 423,
49
+ failed_dependency: 424,
50
+ upgrade_required: 426,
51
+ precondition_required: 428,
52
+
53
+ internal_server_error: 500,
54
+ not_implemented: 501,
55
+ bad_gateway: 502,
56
+ service_unavailable: 503,
57
+ gateway_timeout: 504,
58
+ http_version_not_supported: 505,
59
+ variant_also_negotiates: 506,
60
+ insufficiant_storage: 507,
61
+ loop_detected: 508,
62
+ not_extended: 510,
63
+ network_authentication_required: 511,
64
+ network_connect_timeout_error: 599
65
+ }
66
+ end
@@ -0,0 +1,3 @@
1
+ module ResponseCode
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,14 @@
1
+ require 'response_code/version'
2
+ require 'response_code/codes'
3
+
4
+ module ResponseCode
5
+
6
+ def self.method_missing(m, *args, &block)
7
+ if ResponseCode::CODES.include?(m.to_sym)
8
+ ResponseCode::CODES[m.to_sym]
9
+ else
10
+ raise 'Not a valid status!'
11
+ end
12
+ end
13
+ end
14
+
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: response_code
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mark Torok
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Collection of response codes in readable and talkative way.
14
+ email: torokmark@gmx.com
15
+ executables:
16
+ - response_code
17
+ extensions: []
18
+ extra_rdoc_files:
19
+ - README.md
20
+ files:
21
+ - LICENSE
22
+ - README.md
23
+ - bin/response_code
24
+ - lib/response_code.rb
25
+ - lib/response_code/codes.rb
26
+ - lib/response_code/version.rb
27
+ homepage: http://github.com/torokmark/response_code
28
+ licenses:
29
+ - MIT
30
+ metadata: {}
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 2.7.3
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: Readable way of response codes.
51
+ test_files: []