rack-varnish-esi 0.0.2 → 0.0.3
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 +4 -4
- data/bin/rake +16 -0
- data/lib/rack/varnish_esi_processor.rb +1 -1
- data/lib/rack/varnish_esi_version.rb +1 -1
- data/rack-varnish-esi.gemspec +1 -0
- data/test/minitest_helper.rb +1 -0
- data/test/test_rack_varnish_esi.rb +2 -0
- data/test/test_varnish_esi_processor.rb +32 -0
- metadata +20 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e82b47df9d83984078b8c319a2ff76ed8f13e29e
|
|
4
|
+
data.tar.gz: e3bc74e67a1b8d23b8b2bd42aba45dd7bb268ac8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25f7a8579e5fea4679c99ac127b57ca109e71618d5789ea330e94e58d32996d6c87e5e5bd9c40ad77e3c081396c9a50079761b7fb2eaab13b34e65316acb5eaa
|
|
7
|
+
data.tar.gz: ac4bfac1131a090d98d163d1cbab01b7322267a67edf632fb3ac16901cccbddd7814950ca8be641a4379ab231cfefa4ef1b18e079427799afa852abbab6c4fa8
|
data/bin/rake
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
data/rack-varnish-esi.gemspec
CHANGED
data/test/minitest_helper.rb
CHANGED
|
@@ -10,6 +10,8 @@ class TestRackVarnishEsi < Minitest::Test
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def test_that_it_has_the_same_behavior_as_varnish
|
|
13
|
+
WebMock.allow_net_connect!
|
|
14
|
+
|
|
13
15
|
http_server_thread = start_http_server_with_varnish_esi_middleware(
|
|
14
16
|
:locations => {/.*/ => 'http://localhost:8080'},
|
|
15
17
|
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'minitest_helper'
|
|
2
|
+
|
|
3
|
+
class TestRackVarnishEsiProcessor < Minitest::Test
|
|
4
|
+
def test_that_it_forces_the_encoding_of_the_context
|
|
5
|
+
WebMock.disable_net_connect!
|
|
6
|
+
|
|
7
|
+
processor = Rack::VarnishEsiProcessor.new(
|
|
8
|
+
/.*/ => 'http://rack-varnish-esi.test'
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
body = <<-eos
|
|
12
|
+
<html>
|
|
13
|
+
<body>
|
|
14
|
+
<esi:include src="/some/location">
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
17
|
+
eos
|
|
18
|
+
|
|
19
|
+
expected = <<-eos
|
|
20
|
+
<html>
|
|
21
|
+
<body>
|
|
22
|
+
<p>€254</p>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
25
|
+
eos
|
|
26
|
+
|
|
27
|
+
stub_request(:get, "http://rack-varnish-esi.test/some/location").to_return(:status => 200, :body => "<p>€254</p>".force_encoding("ASCII-8BIT"), :headers => {})
|
|
28
|
+
|
|
29
|
+
processed = processor.process(body.strip.split("\n"))
|
|
30
|
+
assert_equal expected.strip, processed.join("\n").strip
|
|
31
|
+
end
|
|
32
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rack-varnish-esi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Marek
|
|
@@ -66,12 +66,27 @@ dependencies:
|
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: webmock
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
69
83
|
description: |-
|
|
70
84
|
rack-varnish-esi is a Varnish ESI middleware implementation for Rack which is as close as possible to Varnish's own ESI implementation.
|
|
71
85
|
Note: This gem should only be used in development.
|
|
72
86
|
email:
|
|
73
87
|
- thomas_marek@gmx.net
|
|
74
|
-
executables:
|
|
88
|
+
executables:
|
|
89
|
+
- rake
|
|
75
90
|
extensions: []
|
|
76
91
|
extra_rdoc_files: []
|
|
77
92
|
files:
|
|
@@ -80,6 +95,7 @@ files:
|
|
|
80
95
|
- LICENSE.txt
|
|
81
96
|
- README.md
|
|
82
97
|
- Rakefile
|
|
98
|
+
- bin/rake
|
|
83
99
|
- lib/rack-varnish-esi.rb
|
|
84
100
|
- lib/rack/varnish_esi.rb
|
|
85
101
|
- lib/rack/varnish_esi_processor.rb
|
|
@@ -97,6 +113,7 @@ files:
|
|
|
97
113
|
- test/static_server/public/subdir/full_name.html
|
|
98
114
|
- test/static_server/public/unicode.txt
|
|
99
115
|
- test/test_rack_varnish_esi.rb
|
|
116
|
+
- test/test_varnish_esi_processor.rb
|
|
100
117
|
homepage: https://github.com/tmak/rack-varnish-esi
|
|
101
118
|
licenses:
|
|
102
119
|
- MIT
|
|
@@ -134,3 +151,4 @@ test_files:
|
|
|
134
151
|
- test/static_server/public/subdir/full_name.html
|
|
135
152
|
- test/static_server/public/unicode.txt
|
|
136
153
|
- test/test_rack_varnish_esi.rb
|
|
154
|
+
- test/test_varnish_esi_processor.rb
|