wants 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (C) 2012 James A. Rosen
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -27,10 +27,12 @@ module Wants
27
27
 
28
28
  def any(&block)
29
29
  @response_value ||= block.call if present?
30
+ @response_value
30
31
  end
31
32
 
32
33
  def not_acceptable(&block)
33
34
  @response_value ||= block.call if blank?
35
+ @response_value
34
36
  end
35
37
 
36
38
  def method_missing(method, *args, &block)
@@ -30,6 +30,11 @@ describe Wants do
30
30
  subject.any { evaluated += 1; 'not acceptable' }.should == nil
31
31
  evaluated.should == 0
32
32
  end
33
+
34
+ it "doesn't shadow previous results" do
35
+ subject.not_acceptable { 'not acceptable' }
36
+ subject.any { 'any' }.should == 'not acceptable'
37
+ end
33
38
  end
34
39
 
35
40
  describe 'not_acceptable' do
@@ -140,6 +145,11 @@ describe Wants do
140
145
  subject.not_acceptable { evaluated += 1; 'not acceptable' }.should == nil
141
146
  evaluated.should == 0
142
147
  end
148
+
149
+ it "doesn't shadow previous results" do
150
+ subject.html { 'html' }
151
+ subject.not_acceptable { 'not acceptable' }.should == 'html'
152
+ end
143
153
  end
144
154
 
145
155
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wants
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-19 00:00:00.000000000 Z
12
+ date: 2012-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70096785862400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *70096785862400
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rspec
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70096785861660 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *70096785861660
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: rake
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70096785860840 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,12 +43,7 @@ dependencies:
53
43
  version: '0'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *70096785860840
62
47
  description: Parse and query the HTTP Accept header
63
48
  email: james.a.rosen@gmail.com
64
49
  executables: []
@@ -70,6 +55,7 @@ files:
70
55
  - lib/wants/validate_accepts_middleware.rb
71
56
  - lib/wants.rb
72
57
  - README.md
58
+ - LICENSE
73
59
  - spec/match_result_spec.rb
74
60
  - spec/spec_helper.rb
75
61
  - spec/validate_accepts_middleware_spec.rb
@@ -94,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
80
  version: '0'
95
81
  requirements: []
96
82
  rubyforge_project:
97
- rubygems_version: 1.8.24
83
+ rubygems_version: 1.8.10
98
84
  signing_key:
99
85
  specification_version: 2
100
86
  summary: HTTP Accept header support