spryte 0.0.1.pre7 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5c0173de0c0c1fac8666bbfabbc9d177d86e613
4
- data.tar.gz: 5f1ba24e609b3614693382a0c31df786e6000327
3
+ metadata.gz: 8e848659c51f10b362f7d2f7b78e77a009d5b7dd
4
+ data.tar.gz: be3064a31f4d4aff2d8180ecb2516063334b362f
5
5
  SHA512:
6
- metadata.gz: d6bc81bd1ee822326f0c14edfad3cb890cdd4a38e00c71421e60f8c2b3112e3e90ff0d8384b95a6d8ec1a07d2984f3224816d8464916812efa954d3110329853
7
- data.tar.gz: f3c9ad0cf6b2711a220bbb6de673e7a89cd26970952ec1d447eb918c97ba06c1695c2706f042cc5af2028bb065924709cd259e15ddc1d82684d368754110923e
6
+ metadata.gz: 74d3e2d2884cf52dc11af12b86a56c8a0aefb5d4df8c5d847105c03978d7c285ef8c82316e19128df075bb44dcd64e1deb67328f5fefdc25fe477f090baf3e8a
7
+ data.tar.gz: 8e56fe3e7a0d1df76cae8698480035d5405397b677d4744fe4a8209b7c0c150feee1ff2b98043a0555881f0fbe971c1a9c31f8c9b76f5b700e5a10160566e632
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 0.0.2
4
+ - (Bug) Raise exception on invalid HTTP verbs [@dgmstuart](https://github.com/dgmstuart)
5
+
6
+ ## 0.0.1
7
+ - Initial release
@@ -2,6 +2,8 @@ module Spryte
2
2
  module RSpec
3
3
  module Macros
4
4
 
5
+ class InvalidHTTPVerb < StandardError; end
6
+
5
7
  def host(domain)
6
8
  before(:each) { self.host = domain }
7
9
  end
@@ -25,6 +27,7 @@ module Spryte
25
27
  end
26
28
 
27
29
  def method(verb)
30
+ raise InvalidHTTPVerb, invalid_http_verb_message(verb) unless valid_http_verb?(verb)
28
31
  let(:method) { verb.to_sym }
29
32
  end
30
33
 
@@ -44,6 +47,31 @@ module Spryte
44
47
  end
45
48
  end
46
49
 
50
+ private def valid_http_verb?(verb)
51
+ VALID_HTTP_VERBS.include?(verb)
52
+ end
53
+
54
+ private def invalid_http_verb_message(verb)
55
+ "#{verb} is not a valid http verb.\nValid verbs are:\n#{VALID_HTTP_VERBS.map(&:inspect).join("\n")}"
56
+ end
57
+
58
+ VALID_HTTP_VERBS = [
59
+ :get,
60
+ :head,
61
+ :post,
62
+ :patch,
63
+ :put,
64
+ :proppatch,
65
+ :lock,
66
+ :unlock,
67
+ :options,
68
+ :propfind,
69
+ :delete,
70
+ :move,
71
+ :copy,
72
+ :mkcol,
73
+ :trace,
74
+ ]
47
75
  end
48
76
  end
49
- end
77
+ end
@@ -1,6 +1,6 @@
1
1
  module Spryte
2
2
  MAJOR = "0"
3
3
  MINOR = "0"
4
- PATCH = "1.pre7"
4
+ PATCH = "2"
5
5
  VERSION = [ MAJOR, MINOR, PATCH ].join(".")
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spryte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre7
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -46,6 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
+ - CHANGELOG.md
49
50
  - Gemfile
50
51
  - LICENSE.txt
51
52
  - README.md
@@ -75,12 +76,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
76
  version: '0'
76
77
  required_rubygems_version: !ruby/object:Gem::Requirement
77
78
  requirements:
78
- - - ">"
79
+ - - ">="
79
80
  - !ruby/object:Gem::Version
80
- version: 1.3.1
81
+ version: '0'
81
82
  requirements: []
82
83
  rubyforge_project:
83
- rubygems_version: 2.2.2
84
+ rubygems_version: 2.4.5
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: API builder tools for Ruby on Rails