httpcode 1.2 → 1.3

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
+ SHA1:
3
+ metadata.gz: 2d2e82a06d2b4a27c75061c8ad0b39166a5ae886
4
+ data.tar.gz: 9d37444da454833e69141c2db87011775298a4b2
5
+ SHA512:
6
+ metadata.gz: 3a7fc2e46657e313b63d82ea85573b5cff3fdd6518becea246ed7e8141b240ea79bd2825e5811e1364115b3035aa77f94119ce59b140e2b0616bc211e04aa2b5
7
+ data.tar.gz: 925961c11037cffb90828a5a131cd9823bdadffcbfd6c7e8011ae04f2a875cf6a2e5fd4f447ff4666d42b0b2e1dfc18ba59ad3077203226bb755980fd97c3af9
data/README.md CHANGED
@@ -20,6 +20,8 @@ Allows you to specify http status codes by name rather than magic numbers for mo
20
20
  => #<StatusCode:0x007fb85403e1c0 @code=202, @message="Accepted", @symbol=:accepted>
21
21
  status.code
22
22
  => 202
23
+ status.to_i
24
+ => 202
23
25
  status.message
24
26
  => "Accepted"
25
27
  status.code_and_message
@@ -37,58 +39,59 @@ Allows you to specify http status codes by name rather than magic numbers for mo
37
39
  Now we know that we can call HttpStatus.ok
38
40
 
39
41
  ## Full list of statuses you can call:
40
- HttpStatus.continue
41
- HttpStatus.switching_protocols
42
- HttpStatus.processing
43
- HttpStatus.ok
44
- HttpStatus.created
45
- HttpStatus.accepted
46
- HttpStatus.non_authoritative_information
47
- HttpStatus.no_content
48
- HttpStatus.reset_content
49
- HttpStatus.partial_content
50
- HttpStatus.multi_status
51
- HttpStatus.im_used
52
- HttpStatus.multiple_choices
53
- HttpStatus.moved_permanently
54
- HttpStatus.found
55
- HttpStatus.see_other
56
- HttpStatus.not_modified
57
- HttpStatus.use_proxy
58
- HttpStatus.reserved
59
- HttpStatus.temporary_redirect
60
- HttpStatus.bad_request
61
- HttpStatus.unauthorized
62
- HttpStatus.payment_required
63
- HttpStatus.forbidden
64
- HttpStatus.not_found
65
- HttpStatus.method_not_allowed
66
- HttpStatus.not_acceptable
67
- HttpStatus.proxy_authentication_required
68
- HttpStatus.request_timeout
69
- HttpStatus.conflict
70
- HttpStatus.gone
71
- HttpStatus.length_required
72
- HttpStatus.precondition_failed
73
- HttpStatus.request_entity_too_large
74
- HttpStatus.request_uri_too_long
75
- HttpStatus.unsupported_media_type
76
- HttpStatus.requested_range_not_satisfiable
77
- HttpStatus.expectation_failed
78
- HttpStatus.im_a_teapot
79
- HttpStatus.unprocessable_entity
80
- HttpStatus.locked
81
- HttpStatus.failed_dependency
82
- HttpStatus.upgrade_required
83
- HttpStatus.internal_server_error
84
- HttpStatus.not_implemented
85
- HttpStatus.bad_gateway
86
- HttpStatus.service_unavailable
87
- HttpStatus.gateway_timeout
88
- HttpStatus.http_version_not_supported
89
- HttpStatus.variant_also_negotiates
90
- HttpStatus.insufficient_storage
91
- HttpStatus.not_extended
42
+ HttpStatus.continue 100
43
+ HttpStatus.switching_protocols 101
44
+ HttpStatus.processing 102
45
+ HttpStatus.ok 200
46
+ HttpStatus.created 201
47
+ HttpStatus.accepted 202
48
+ HttpStatus.non_authoritative_information 203
49
+ HttpStatus.no_content 204
50
+ HttpStatus.reset_content 205
51
+ HttpStatus.partial_content 206
52
+ HttpStatus.multi_status 207
53
+ HttpStatus.im_used 226
54
+ HttpStatus.multiple_choices 300
55
+ HttpStatus.moved_permanently 301
56
+ HttpStatus.found 302
57
+ HttpStatus.see_other 303
58
+ HttpStatus.not_modified 304
59
+ HttpStatus.use_proxy 305
60
+ HttpStatus.reserved 306
61
+ HttpStatus.temporary_redirect 307
62
+ HttpStatus.bad_request 400
63
+ HttpStatus.unauthorized 401
64
+ HttpStatus.payment_required 402
65
+ HttpStatus.forbidden 403
66
+ HttpStatus.not_found 404
67
+ HttpStatus.method_not_allowed 405
68
+ HttpStatus.not_acceptable 406
69
+ HttpStatus.proxy_authentication_required 407
70
+ HttpStatus.request_timeout 408
71
+ HttpStatus.conflict 409
72
+ HttpStatus.gone 410
73
+ HttpStatus.length_required 411
74
+ HttpStatus.precondition_failed 412
75
+ HttpStatus.request_entity_too_large 413
76
+ HttpStatus.request_uri_too_long 414
77
+ HttpStatus.unsupported_media_type 415
78
+ HttpStatus.requested_range_not_satisfiable 416
79
+ HttpStatus.expectation_failed 417
80
+ HttpStatus.im_a_teapot 418
81
+ HttpStatus.unprocessable_entity 422
82
+ HttpStatus.locked 423
83
+ HttpStatus.failed_dependency 424
84
+ HttpStatus.upgrade_required 426
85
+ HttpStatus.internal_server_error 500
86
+ HttpStatus.not_implemented 501
87
+ HttpStatus.bad_gateway 502
88
+ HttpStatus.service_unavailable 503
89
+ HttpStatus.gateway_timeout 504
90
+ HttpStatus.http_version_not_supported 505
91
+ HttpStatus.variant_also_negotiates 506
92
+ HttpStatus.insufficient_storage 507
93
+ HttpStatus.not_extended 510
94
+
92
95
 
93
96
  ## Additional methods
94
97
  HttpStatus.valid_codes
@@ -104,3 +107,7 @@ Allows you to specify http status codes by name rather than magic numbers for mo
104
107
  3. Commit your changes (`git commit -am 'Add some feature'`)
105
108
  4. Push to the branch (`git push origin my-new-feature`)
106
109
  5. Create new Pull Request
110
+
111
+ or.......
112
+ If you have any suggestions for how to make this better or extend it, please email me at MishaAConway@gmail.com and I
113
+ will be happy to consider suggestions.
data/httpcode.gemspec CHANGED
@@ -18,4 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
19
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
20
  gem.require_paths = ["lib"]
21
+
22
+ gem.add_development_dependency 'activesupport'
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module Httpcode
2
- VERSION = "1.2"
2
+ VERSION = "1.3"
3
3
  end
data/lib/httpcode.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "httpcode/version"
2
+ require "active_support/core_ext/class/attribute_accessors"
2
3
 
3
4
  class StatusCode
4
5
  attr_reader :symbol, :code, :message
@@ -20,6 +21,10 @@ class StatusCode
20
21
  #end
21
22
  end
22
23
 
24
+
25
+
26
+
27
+
23
28
  class HttpStatus
24
29
  def self.valid_codes
25
30
  [:continue,
metadata CHANGED
@@ -1,16 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpcode
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
5
- prerelease:
4
+ version: '1.3'
6
5
  platform: ruby
7
6
  authors:
8
7
  - Misha Conway
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-28 00:00:00.000000000 Z
13
- dependencies: []
11
+ date: 2013-07-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
14
27
  description:
15
28
  email:
16
29
  - MishaAConway@gmail.com
@@ -28,27 +41,26 @@ files:
28
41
  - lib/httpcode/version.rb
29
42
  homepage: https://github.com/MishaConway/httpcode
30
43
  licenses: []
44
+ metadata: {}
31
45
  post_install_message:
32
46
  rdoc_options: []
33
47
  require_paths:
34
48
  - lib
35
49
  required_ruby_version: !ruby/object:Gem::Requirement
36
50
  requirements:
37
- - - ! '>='
51
+ - - '>='
38
52
  - !ruby/object:Gem::Version
39
53
  version: '0'
40
- none: false
41
54
  required_rubygems_version: !ruby/object:Gem::Requirement
42
55
  requirements:
43
- - - ! '>='
56
+ - - '>='
44
57
  - !ruby/object:Gem::Version
45
58
  version: '0'
46
- none: false
47
59
  requirements: []
48
60
  rubyforge_project:
49
- rubygems_version: 1.8.24
61
+ rubygems_version: 2.0.3
50
62
  signing_key:
51
- specification_version: 3
63
+ specification_version: 4
52
64
  summary: Allows you to specify http status codes by name rather than magic numbers
53
65
  for more readable code. Go to https://github.com/MishaConway/httpcode for detailed
54
66
  examples.