ventilation 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/app/helpers/esi_helper.rb +1 -0
- data/lib/ventilation/deep_stack.rb +17 -2
- data/test/test_helper.rb +1 -0
- data/test/ventilation_test.rb +6 -3
- data/ventilation.gemspec +2 -2
- metadata +4 -10
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -1,8 +1,21 @@
|
|
1
1
|
module Ventilation
|
2
|
+
|
3
|
+
# Detect rails 2 or 3 by looking for TestProcess which
|
4
|
+
# was removed in Rails 3.
|
5
|
+
unless defined?(ActionController::TestProcess)
|
6
|
+
# In Rails 3 the functionlity needed can be inherited
|
7
|
+
# from TestCase.
|
8
|
+
class DeepStack < ActionController::TestCase; end
|
9
|
+
else
|
10
|
+
# The Rails 2 the needed functionality can be included
|
11
|
+
# from TestProcess.
|
12
|
+
class DeepStack
|
13
|
+
include ActionController::TestProcess
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
2
17
|
# Simulate concurrency by serving request recursively.
|
3
18
|
class DeepStack
|
4
|
-
include ActionController::TestProcess
|
5
|
-
|
6
19
|
def initialize(controller_class)
|
7
20
|
@request = ActionController::TestRequest.new
|
8
21
|
@response = ActionController::TestResponse.new
|
@@ -16,4 +29,6 @@ module Ventilation
|
|
16
29
|
end
|
17
30
|
end
|
18
31
|
end
|
32
|
+
|
33
|
+
|
19
34
|
end
|
data/test/test_helper.rb
CHANGED
data/test/ventilation_test.rb
CHANGED
@@ -12,9 +12,14 @@ class TestVentilation < Test::Unit::TestCase
|
|
12
12
|
should "render external resource" do
|
13
13
|
expected = "response_from_example.com"
|
14
14
|
FakeWeb.register_uri(:get, "http://example.com/", :body => expected)
|
15
|
-
|
16
15
|
actual = @consumer.esi 'http://example.com/'
|
16
|
+
assert_equal expected, actual, "Expected response was not rendered by esi method"
|
17
|
+
end
|
17
18
|
|
19
|
+
should "render external resource with port number" do
|
20
|
+
expected = "response_from_example.com_port_4000"
|
21
|
+
FakeWeb.register_uri(:get, "http://example.com:4000/", :body => expected)
|
22
|
+
actual = @consumer.esi 'http://example.com:4000/'
|
18
23
|
assert_equal expected, actual, "Expected response was not rendered by esi method"
|
19
24
|
end
|
20
25
|
|
@@ -25,9 +30,7 @@ class TestVentilation < Test::Unit::TestCase
|
|
25
30
|
deep_stack = mock()
|
26
31
|
deep_stack.expects(:get).with(:index).returns(response)
|
27
32
|
Ventilation::DeepStack.expects(:new).with(WelcomeController).returns(deep_stack)
|
28
|
-
|
29
33
|
actual = @consumer.esi :index, :controller => :welcome
|
30
|
-
|
31
34
|
assert_equal expected, actual
|
32
35
|
end
|
33
36
|
|
data/ventilation.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ventilation}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Blake Taylor"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-02}
|
13
13
|
s.description = %q{Helper methods for building esi tags, simplifies development bypassing the need for varnish.}
|
14
14
|
s.email = %q{btaylor@agoragames.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ventilation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 29
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Blake Taylor
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-11-02 00:00:00 -04:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
@@ -40,7 +38,6 @@ dependencies:
|
|
40
38
|
requirements:
|
41
39
|
- - ">="
|
42
40
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 15
|
44
41
|
segments:
|
45
42
|
- 1
|
46
43
|
- 2
|
@@ -56,7 +53,6 @@ dependencies:
|
|
56
53
|
requirements:
|
57
54
|
- - ">="
|
58
55
|
- !ruby/object:Gem::Version
|
59
|
-
hash: 43
|
60
56
|
segments:
|
61
57
|
- 0
|
62
58
|
- 9
|
@@ -102,7 +98,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
98
|
requirements:
|
103
99
|
- - ">="
|
104
100
|
- !ruby/object:Gem::Version
|
105
|
-
hash: 3
|
106
101
|
segments:
|
107
102
|
- 0
|
108
103
|
version: "0"
|
@@ -111,7 +106,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
106
|
requirements:
|
112
107
|
- - ">="
|
113
108
|
- !ruby/object:Gem::Version
|
114
|
-
hash: 3
|
115
109
|
segments:
|
116
110
|
- 0
|
117
111
|
version: "0"
|