http_status 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 192dfeb982729a6b36a7323a168998337e6c03d5
4
+ data.tar.gz: 9aa144072a90a993f0530782f7a6d421f4799af5
5
+ SHA512:
6
+ metadata.gz: 4ff12dbc235fb459eefa2a940230165320e88169343d99931f2b0f60760232d5ca01a885451e179c263e79a94c8e26ef96f197fc47bb235a730adeb4766f431b
7
+ data.tar.gz: 7872c55cbb7c8e142444634cd57ef1efa0b3948732c183fb4e5d67b6d9539307119c51e4cf999247420e45c595971801d4880f70469daddce945bae8e1a83bf4
data/.gitignore ADDED
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in http_status.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ guard :rspec, :cmd => 'rspec --color' do
4
+ watch(%r{^spec/.+_spec\.rb$})
5
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
6
+ watch('spec/spec_helper.rb') { "spec" }
7
+ end
8
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Jikku Jose
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.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # http_status
2
+
3
+ A simple gem to access HTTP statuses.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'http_status'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install http_status
18
+
19
+ ## Usage
20
+
21
+ HTTPStatus::Ok # gives 200
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/JikkuJose/http_status/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -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 'http_status/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "http_status"
8
+ spec.version = HTTPStatus::VERSION
9
+ spec.authors = ["Jikku Jose"]
10
+ spec.email = ["jikkujose@gmail.com"]
11
+ spec.summary = %q{Simple gem to access HTTP statuses}
12
+ spec.description = %q{Simple gem to access HTTP statuses}
13
+ spec.homepage = "http://github.com/JikkuJose/http_status/"
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.5"
22
+ spec.add_development_dependency "guard"
23
+ spec.add_development_dependency "guard-rspec"
24
+ spec.add_development_dependency "rake"
25
+ end
@@ -0,0 +1,87 @@
1
+ require "http_status/version"
2
+
3
+ module HTTPStatus
4
+
5
+ Continue = 100
6
+ SwitchProtocols = 101
7
+ Processing = 102
8
+ Ok = 200
9
+ Created = 201
10
+ Accepted = 202
11
+ NonAuthoritative = 203
12
+ NoContent = 204
13
+ ResetContent = 205
14
+ PartialContent = 206
15
+ MultiStatus = 207
16
+ AlreadyReported = 208
17
+ ImUsed = 226
18
+ MultipleChoices = 300
19
+ MovedPermanently = 301
20
+ Found = 302
21
+ SeeOther = 303
22
+ NotModified = 304
23
+ UseProxy = 305
24
+ SwitchProxy = 306
25
+ TemporaryRedirect = 307
26
+ PermanentRedirect = 308
27
+ BadRequest = 400
28
+ Unauthorized = 401
29
+ PaymentRequired = 402
30
+ Forbidden = 403
31
+ NotFound = 404
32
+ MethodNotAllowed = 405
33
+ NotAcceptable = 406
34
+ ProxyAuthenticationRequired = 407
35
+ RequestTimeout = 408
36
+ Conflict = 409
37
+ Gone = 410
38
+ LengthRequired = 411
39
+ PreconditionFailed = 412
40
+ RequestEntityTooLarge = 413
41
+ RequestUriTooLong = 414
42
+ UnsupportedMediaType = 415
43
+ RequestedRangeNotSatisfiable = 416
44
+ ExpectationFailed = 417
45
+ ImATeapot = 418
46
+ AuthenticationTimeout = 419
47
+ MethodFailure = 420
48
+ EnhanceYourCalm = 420
49
+ UnprocessableEntity = 422
50
+ Locked = 423
51
+ FailedDependency = 424
52
+ UnorderedCollection = 425
53
+ UpgradeRequired = 426
54
+ PreconditionRequired = 428
55
+ TooManyRequests = 429
56
+ RequestHeaderFieldsTooLarge = 431
57
+ LoginTimeout = 440
58
+ NoResponse = 444
59
+ RetryWith = 449
60
+ BlockedByWindowsParentalControls = 450
61
+ UnavailableForLegalReasons = 451
62
+ RequestHeaderTooLarge = 494
63
+ CertError = 495
64
+ NoCert = 496
65
+ HttpToHttps = 497
66
+ ClientClosedRequest = 499
67
+ InternalServerError = 500
68
+ NotImplemented = 501
69
+ BadGateway = 502
70
+ ServiceUnavailable = 503
71
+ GatewayTimeout = 504
72
+ HttpVersionNotSupported = 505
73
+ VariantAlsoNegotiates = 506
74
+ InsuficientStorage = 507
75
+ LoopDetected = 508
76
+ BandwidthLimitExceeded = 509
77
+ NotExtended = 510
78
+ NetworkAuthenticationReuired = 511
79
+ OriginError = 520
80
+ WebServerIsDown = 521
81
+ ConnectionTimedOut = 522
82
+ ProxyDeclinedRequest = 523
83
+ ATimeoutOccured = 524
84
+ NetworkReadTimeoutError = 598
85
+ NetworkConnectTimeoutError = 599
86
+
87
+ end
@@ -0,0 +1,3 @@
1
+ module HTTPStatus
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,95 @@
1
+ require 'http_status'
2
+
3
+ describe HTTPStatus do
4
+
5
+ {
6
+ HTTPStatus::Continue => 100,
7
+ HTTPStatus::SwitchProtocols => 101,
8
+ HTTPStatus::Processing => 102,
9
+ HTTPStatus::Ok => 200,
10
+ HTTPStatus::Created => 201,
11
+ HTTPStatus::Accepted => 202,
12
+ HTTPStatus::NonAuthoritative => 203,
13
+ HTTPStatus::NoContent => 204,
14
+ HTTPStatus::ResetContent => 205,
15
+ HTTPStatus::PartialContent => 206,
16
+ HTTPStatus::MultiStatus => 207,
17
+ HTTPStatus::AlreadyReported => 208,
18
+ HTTPStatus::ImUsed => 226,
19
+ HTTPStatus::MultipleChoices => 300,
20
+ HTTPStatus::MovedPermanently => 301,
21
+ HTTPStatus::Found => 302,
22
+ HTTPStatus::SeeOther => 303,
23
+ HTTPStatus::NotModified => 304,
24
+ HTTPStatus::UseProxy => 305,
25
+ HTTPStatus::SwitchProxy => 306,
26
+ HTTPStatus::TemporaryRedirect => 307,
27
+ HTTPStatus::PermanentRedirect => 308,
28
+ HTTPStatus::BadRequest => 400,
29
+ HTTPStatus::Unauthorized => 401,
30
+ HTTPStatus::PaymentRequired => 402,
31
+ HTTPStatus::Forbidden => 403,
32
+ HTTPStatus::NotFound => 404,
33
+ HTTPStatus::MethodNotAllowed => 405,
34
+ HTTPStatus::NotAcceptable => 406,
35
+ HTTPStatus::ProxyAuthenticationRequired => 407,
36
+ HTTPStatus::RequestTimeout => 408,
37
+ HTTPStatus::Conflict => 409,
38
+ HTTPStatus::Gone => 410,
39
+ HTTPStatus::LengthRequired => 411,
40
+ HTTPStatus::PreconditionFailed => 412,
41
+ HTTPStatus::RequestEntityTooLarge => 413,
42
+ HTTPStatus::RequestUriTooLong => 414,
43
+ HTTPStatus::UnsupportedMediaType => 415,
44
+ HTTPStatus::RequestedRangeNotSatisfiable => 416,
45
+ HTTPStatus::ExpectationFailed => 417,
46
+ HTTPStatus::ImATeapot => 418,
47
+ HTTPStatus::AuthenticationTimeout => 419,
48
+ HTTPStatus::MethodFailure => 420,
49
+ HTTPStatus::EnhanceYourCalm => 420,
50
+ HTTPStatus::UnprocessableEntity => 422,
51
+ HTTPStatus::Locked => 423,
52
+ HTTPStatus::FailedDependency => 424,
53
+ HTTPStatus::UnorderedCollection => 425,
54
+ HTTPStatus::UpgradeRequired => 426,
55
+ HTTPStatus::PreconditionRequired => 428,
56
+ HTTPStatus::TooManyRequests => 429,
57
+ HTTPStatus::RequestHeaderFieldsTooLarge => 431,
58
+ HTTPStatus::LoginTimeout => 440,
59
+ HTTPStatus::NoResponse => 444,
60
+ HTTPStatus::RetryWith => 449,
61
+ HTTPStatus::BlockedByWindowsParentalControls => 450,
62
+ HTTPStatus::UnavailableForLegalReasons => 451,
63
+ HTTPStatus::RequestHeaderTooLarge => 494,
64
+ HTTPStatus::CertError => 495,
65
+ HTTPStatus::NoCert => 496,
66
+ HTTPStatus::HttpToHttps => 497,
67
+ HTTPStatus::ClientClosedRequest => 499,
68
+ HTTPStatus::InternalServerError => 500,
69
+ HTTPStatus::NotImplemented => 501,
70
+ HTTPStatus::BadGateway => 502,
71
+ HTTPStatus::ServiceUnavailable => 503,
72
+ HTTPStatus::GatewayTimeout => 504,
73
+ HTTPStatus::HttpVersionNotSupported => 505,
74
+ HTTPStatus::VariantAlsoNegotiates => 506,
75
+ HTTPStatus::InsuficientStorage => 507,
76
+ HTTPStatus::LoopDetected => 508,
77
+ HTTPStatus::BandwidthLimitExceeded => 509,
78
+ HTTPStatus::NotExtended => 510,
79
+ HTTPStatus::NetworkAuthenticationReuired => 511,
80
+ HTTPStatus::OriginError => 520,
81
+ HTTPStatus::WebServerIsDown => 521,
82
+ HTTPStatus::ConnectionTimedOut => 522,
83
+ HTTPStatus::ProxyDeclinedRequest => 523,
84
+ HTTPStatus::ATimeoutOccured => 524,
85
+ HTTPStatus::NetworkReadTimeoutError => 598,
86
+ HTTPStatus::NetworkConnectTimeoutError => 599
87
+ }.each do |constant, code|
88
+
89
+ it "has a constant #{constant.to_s} is #{code}" do
90
+ constant.should == code
91
+ end
92
+
93
+ end
94
+
95
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: http_status
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jikku Jose
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-26 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.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard
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: guard-rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Simple gem to access HTTP statuses
70
+ email:
71
+ - jikkujose@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - Guardfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - http_status.gemspec
83
+ - lib/http_status.rb
84
+ - lib/http_status/version.rb
85
+ - spec/http_status_spec.rb
86
+ homepage: http://github.com/JikkuJose/http_status/
87
+ licenses:
88
+ - MIT
89
+ metadata: {}
90
+ post_install_message:
91
+ rdoc_options: []
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ requirements: []
105
+ rubyforge_project:
106
+ rubygems_version: 2.2.2
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: Simple gem to access HTTP statuses
110
+ test_files:
111
+ - spec/http_status_spec.rb