easy_esi 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Appraisals +8 -0
- data/Gemfile +6 -7
- data/Gemfile.lock +37 -40
- data/Rakefile +5 -18
- data/Readme.md +7 -4
- data/easy_esi.gemspec +9 -48
- data/gemfiles/rails.3.0.gemfile +11 -0
- data/gemfiles/rails.3.0.gemfile.lock +55 -0
- data/gemfiles/rails.3.1.gemfile +11 -0
- data/gemfiles/rails.3.1.gemfile.lock +63 -0
- data/gemfiles/rails.3.2.gemfile +11 -0
- data/gemfiles/rails.3.2.gemfile.lock +62 -0
- data/lib/easy_esi.rb +18 -28
- data/lib/easy_esi/version.rb +3 -0
- data/test/easy_esi_test.rb +2 -2
- data/test/test_helper.rb +26 -42
- metadata +59 -34
- data/CHANGELOG +0 -1
- data/VERSION +0 -1
- data/init.rb +0 -1
data/.travis.yml
ADDED
data/Appraisals
ADDED
data/Gemfile
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
source :rubygems
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
3
|
+
gem 'bump'
|
4
|
+
gem 'appraisal'
|
5
|
+
gem 'actionpack'
|
6
|
+
gem 'rake'
|
7
|
+
gem 'rspec', '~>2'
|
8
|
+
gem 'test-unit'
|
data/Gemfile.lock
CHANGED
@@ -1,65 +1,62 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionpack (3.
|
5
|
-
activemodel (= 3.
|
6
|
-
activesupport (= 3.
|
4
|
+
actionpack (3.2.9)
|
5
|
+
activemodel (= 3.2.9)
|
6
|
+
activesupport (= 3.2.9)
|
7
7
|
builder (~> 3.0.0)
|
8
8
|
erubis (~> 2.7.0)
|
9
|
-
|
10
|
-
rack (~> 1.
|
11
|
-
rack-cache (~> 1.
|
12
|
-
rack-mount (~> 0.8.2)
|
9
|
+
journey (~> 1.0.4)
|
10
|
+
rack (~> 1.4.0)
|
11
|
+
rack-cache (~> 1.2)
|
13
12
|
rack-test (~> 0.6.1)
|
14
|
-
sprockets (~> 2.
|
15
|
-
activemodel (3.
|
16
|
-
activesupport (= 3.
|
13
|
+
sprockets (~> 2.2.1)
|
14
|
+
activemodel (3.2.9)
|
15
|
+
activesupport (= 3.2.9)
|
17
16
|
builder (~> 3.0.0)
|
17
|
+
activesupport (3.2.9)
|
18
18
|
i18n (~> 0.6)
|
19
|
-
activesupport (3.1.1)
|
20
19
|
multi_json (~> 1.0)
|
21
|
-
|
20
|
+
appraisal (0.5.1)
|
21
|
+
bundler
|
22
|
+
rake
|
23
|
+
builder (3.0.4)
|
24
|
+
bump (0.3.5)
|
22
25
|
diff-lcs (1.1.3)
|
23
26
|
erubis (2.7.0)
|
24
|
-
git (1.2.5)
|
25
27
|
hike (1.2.1)
|
26
|
-
i18n (0.6.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
multi_json (1.0.3)
|
32
|
-
mynyml-redgreen (0.7.1)
|
33
|
-
term-ansicolor (>= 1.0.4)
|
34
|
-
rack (1.3.5)
|
35
|
-
rack-cache (1.1)
|
28
|
+
i18n (0.6.1)
|
29
|
+
journey (1.0.4)
|
30
|
+
multi_json (1.3.7)
|
31
|
+
rack (1.4.1)
|
32
|
+
rack-cache (1.2)
|
36
33
|
rack (>= 0.4)
|
37
|
-
rack-
|
38
|
-
rack (>= 1.0.0)
|
39
|
-
rack-test (0.6.1)
|
34
|
+
rack-test (0.6.2)
|
40
35
|
rack (>= 1.0)
|
41
|
-
rake (0.
|
42
|
-
rspec (2.
|
43
|
-
rspec-core (~> 2.
|
44
|
-
rspec-expectations (~> 2.
|
45
|
-
rspec-mocks (~> 2.
|
46
|
-
rspec-core (2.
|
47
|
-
rspec-expectations (2.
|
48
|
-
diff-lcs (~> 1.1.
|
49
|
-
rspec-mocks (2.
|
50
|
-
sprockets (2.
|
36
|
+
rake (10.0.0)
|
37
|
+
rspec (2.11.0)
|
38
|
+
rspec-core (~> 2.11.0)
|
39
|
+
rspec-expectations (~> 2.11.0)
|
40
|
+
rspec-mocks (~> 2.11.0)
|
41
|
+
rspec-core (2.11.1)
|
42
|
+
rspec-expectations (2.11.3)
|
43
|
+
diff-lcs (~> 1.1.3)
|
44
|
+
rspec-mocks (2.11.3)
|
45
|
+
sprockets (2.2.1)
|
51
46
|
hike (~> 1.2)
|
47
|
+
multi_json (~> 1.0)
|
52
48
|
rack (~> 1.0)
|
53
49
|
tilt (~> 1.1, != 1.3.0)
|
54
|
-
|
50
|
+
test-unit (2.5.2)
|
55
51
|
tilt (1.3.3)
|
56
52
|
|
57
53
|
PLATFORMS
|
58
54
|
ruby
|
59
55
|
|
60
56
|
DEPENDENCIES
|
61
|
-
actionpack
|
62
|
-
|
63
|
-
|
57
|
+
actionpack
|
58
|
+
appraisal
|
59
|
+
bump
|
64
60
|
rake
|
65
61
|
rspec (~> 2)
|
62
|
+
test-unit
|
data/Rakefile
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
1
2
|
require 'rake/testtask'
|
3
|
+
require 'appraisal'
|
4
|
+
require 'bump/tasks'
|
5
|
+
|
2
6
|
Rake::TestTask.new(:test) do |test|
|
3
7
|
test.libs << 'lib'
|
4
8
|
test.pattern = 'test/**/*_test.rb'
|
@@ -6,22 +10,5 @@ Rake::TestTask.new(:test) do |test|
|
|
6
10
|
end
|
7
11
|
|
8
12
|
task :default do
|
9
|
-
sh "
|
10
|
-
sh "RAILS=3.1.0 && (bundle || bundle install) && bundle exec rake test"
|
11
|
-
end
|
12
|
-
|
13
|
-
begin
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
gem.name = 'easy_esi'
|
17
|
-
gem.summary = "Rails: Cached pages with updated partials"
|
18
|
-
gem.email = "michael@grosser.it"
|
19
|
-
gem.homepage = "http://github.com/grosser/#{gem.name}"
|
20
|
-
gem.authors = ["Michael Grosser"]
|
21
|
-
gem.add_runtime_dependency 'activerecord'
|
22
|
-
end
|
23
|
-
|
24
|
-
Jeweler::GemcutterTasks.new
|
25
|
-
rescue LoadError
|
26
|
-
puts "Jeweler, or one of its dependencies, is not available. Install it with: gem install jeweler"
|
13
|
+
sh "bundle exec rake appraisal:install && bundle exec rake appraisal test"
|
27
14
|
end
|
data/Readme.md
CHANGED
@@ -11,9 +11,6 @@ Basics
|
|
11
11
|
[Rails 2 Version](http://github.com/grosser/easy_esi/tree/rails2)
|
12
12
|
|
13
13
|
gem install easy_esi
|
14
|
-
Or
|
15
|
-
|
16
|
-
rails plugin install git://github.com/grosser/easy_esi.git
|
17
14
|
|
18
15
|
### Action-cache the controller (5s)
|
19
16
|
class UsersController < ApplicationController
|
@@ -67,6 +64,12 @@ Compared to normal [ESI](http://en.wikipedia.org/wiki/Edge_Side_Includes) this m
|
|
67
64
|
|
68
65
|
Author
|
69
66
|
======
|
67
|
+
|
68
|
+
### [Contributors](http://github.com/grosser/easy_esi/contributors)
|
69
|
+
- [Nils Landt](http://github.com/promisedlandt)
|
70
|
+
|
70
71
|
[Michael Grosser](http://grosser.it)<br/>
|
71
72
|
michael@grosser.it<br/>
|
72
|
-
|
73
|
+
License: MIT<br/>
|
74
|
+
[![Build Status](https://travis-ci.org/grosser/easy_esi.png)](https://travis-ci.org/grosser/easy_esi)
|
75
|
+
|
data/easy_esi.gemspec
CHANGED
@@ -1,53 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
# -*- encoding: utf-8 -*-
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
2
|
+
name = "easy_esi"
|
3
|
+
require "#{name}/version"
|
5
4
|
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.
|
8
|
-
s.version = "0.2.3"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = "2011-10-27"
|
5
|
+
Gem::Specification.new name, EasyEsi::VERSION do |s|
|
6
|
+
s.authors = "Michael Grosser"
|
13
7
|
s.email = "michael@grosser.it"
|
14
|
-
s.files =
|
15
|
-
|
16
|
-
"Gemfile",
|
17
|
-
"Gemfile.lock",
|
18
|
-
"Rakefile",
|
19
|
-
"Readme.md",
|
20
|
-
"VERSION",
|
21
|
-
"easy_esi.gemspec",
|
22
|
-
"init.rb",
|
23
|
-
"lib/easy_esi.rb",
|
24
|
-
"test/easy_esi_test.rb",
|
25
|
-
"test/test_helper.rb",
|
26
|
-
"test/views/esi_disabled/_a_partial.erb",
|
27
|
-
"test/views/esi_disabled/show.erb",
|
28
|
-
"test/views/esi_disabled/test_filter.erb",
|
29
|
-
"test/views/esi_disabled/with_hash.erb",
|
30
|
-
"test/views/esi_enabled/_a_partial.erb",
|
31
|
-
"test/views/esi_enabled/_unserialize.erb",
|
32
|
-
"test/views/esi_enabled/serialize.erb",
|
33
|
-
"test/views/esi_enabled/show.erb",
|
34
|
-
"test/views/esi_enabled/with_hash.erb"
|
35
|
-
]
|
36
|
-
s.homepage = "http://github.com/grosser/easy_esi"
|
37
|
-
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = "1.8.10"
|
8
|
+
s.files = `git ls-files`.split("\n")
|
9
|
+
s.homepage = "http://github.com/grosser/#{name}"
|
39
10
|
s.summary = "Rails: Cached pages with updated partials"
|
40
|
-
|
41
|
-
|
42
|
-
s.specification_version = 3
|
43
|
-
|
44
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
-
s.add_runtime_dependency(%q<activerecord>, [">= 0"])
|
46
|
-
else
|
47
|
-
s.add_dependency(%q<activerecord>, [">= 0"])
|
48
|
-
end
|
49
|
-
else
|
50
|
-
s.add_dependency(%q<activerecord>, [">= 0"])
|
51
|
-
end
|
11
|
+
s.add_runtime_dependency "actionpack", ">= 2"
|
12
|
+
s.license = "MIT"
|
52
13
|
end
|
53
14
|
|
@@ -0,0 +1,55 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionpack (3.0.17)
|
6
|
+
activemodel (= 3.0.17)
|
7
|
+
activesupport (= 3.0.17)
|
8
|
+
builder (~> 2.1.2)
|
9
|
+
erubis (~> 2.6.6)
|
10
|
+
i18n (~> 0.5.0)
|
11
|
+
rack (~> 1.2.5)
|
12
|
+
rack-mount (~> 0.6.14)
|
13
|
+
rack-test (~> 0.5.7)
|
14
|
+
tzinfo (~> 0.3.23)
|
15
|
+
activemodel (3.0.17)
|
16
|
+
activesupport (= 3.0.17)
|
17
|
+
builder (~> 2.1.2)
|
18
|
+
i18n (~> 0.5.0)
|
19
|
+
activesupport (3.0.17)
|
20
|
+
appraisal (0.5.1)
|
21
|
+
bundler
|
22
|
+
rake
|
23
|
+
builder (2.1.2)
|
24
|
+
bump (0.3.5)
|
25
|
+
diff-lcs (1.1.3)
|
26
|
+
erubis (2.6.6)
|
27
|
+
abstract (>= 1.0.0)
|
28
|
+
i18n (0.5.0)
|
29
|
+
rack (1.2.5)
|
30
|
+
rack-mount (0.6.14)
|
31
|
+
rack (>= 1.0.0)
|
32
|
+
rack-test (0.5.7)
|
33
|
+
rack (>= 1.0)
|
34
|
+
rake (10.0.0)
|
35
|
+
rspec (2.11.0)
|
36
|
+
rspec-core (~> 2.11.0)
|
37
|
+
rspec-expectations (~> 2.11.0)
|
38
|
+
rspec-mocks (~> 2.11.0)
|
39
|
+
rspec-core (2.11.1)
|
40
|
+
rspec-expectations (2.11.3)
|
41
|
+
diff-lcs (~> 1.1.3)
|
42
|
+
rspec-mocks (2.11.3)
|
43
|
+
test-unit (2.5.2)
|
44
|
+
tzinfo (0.3.35)
|
45
|
+
|
46
|
+
PLATFORMS
|
47
|
+
ruby
|
48
|
+
|
49
|
+
DEPENDENCIES
|
50
|
+
actionpack (~> 3.0.0)
|
51
|
+
appraisal
|
52
|
+
bump
|
53
|
+
rake
|
54
|
+
rspec
|
55
|
+
test-unit
|
@@ -0,0 +1,63 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionpack (3.1.1)
|
5
|
+
activemodel (= 3.1.1)
|
6
|
+
activesupport (= 3.1.1)
|
7
|
+
builder (~> 3.0.0)
|
8
|
+
erubis (~> 2.7.0)
|
9
|
+
i18n (~> 0.6)
|
10
|
+
rack (~> 1.3.2)
|
11
|
+
rack-cache (~> 1.1)
|
12
|
+
rack-mount (~> 0.8.2)
|
13
|
+
rack-test (~> 0.6.1)
|
14
|
+
sprockets (~> 2.0.2)
|
15
|
+
activemodel (3.1.1)
|
16
|
+
activesupport (= 3.1.1)
|
17
|
+
builder (~> 3.0.0)
|
18
|
+
i18n (~> 0.6)
|
19
|
+
activesupport (3.1.1)
|
20
|
+
multi_json (~> 1.0)
|
21
|
+
appraisal (0.5.1)
|
22
|
+
bundler
|
23
|
+
rake
|
24
|
+
builder (3.0.4)
|
25
|
+
bump (0.3.5)
|
26
|
+
diff-lcs (1.1.3)
|
27
|
+
erubis (2.7.0)
|
28
|
+
hike (1.2.1)
|
29
|
+
i18n (0.6.1)
|
30
|
+
multi_json (1.3.7)
|
31
|
+
rack (1.3.5)
|
32
|
+
rack-cache (1.2)
|
33
|
+
rack (>= 0.4)
|
34
|
+
rack-mount (0.8.3)
|
35
|
+
rack (>= 1.0.0)
|
36
|
+
rack-test (0.6.2)
|
37
|
+
rack (>= 1.0)
|
38
|
+
rake (10.0.0)
|
39
|
+
rspec (2.11.0)
|
40
|
+
rspec-core (~> 2.11.0)
|
41
|
+
rspec-expectations (~> 2.11.0)
|
42
|
+
rspec-mocks (~> 2.11.0)
|
43
|
+
rspec-core (2.11.1)
|
44
|
+
rspec-expectations (2.11.3)
|
45
|
+
diff-lcs (~> 1.1.3)
|
46
|
+
rspec-mocks (2.11.3)
|
47
|
+
sprockets (2.0.3)
|
48
|
+
hike (~> 1.2)
|
49
|
+
rack (~> 1.0)
|
50
|
+
tilt (~> 1.1, != 1.3.0)
|
51
|
+
test-unit (2.5.2)
|
52
|
+
tilt (1.3.3)
|
53
|
+
|
54
|
+
PLATFORMS
|
55
|
+
ruby
|
56
|
+
|
57
|
+
DEPENDENCIES
|
58
|
+
actionpack (~> 3.1.0)
|
59
|
+
appraisal
|
60
|
+
bump
|
61
|
+
rake
|
62
|
+
rspec
|
63
|
+
test-unit
|
@@ -0,0 +1,62 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionpack (3.2.9)
|
5
|
+
activemodel (= 3.2.9)
|
6
|
+
activesupport (= 3.2.9)
|
7
|
+
builder (~> 3.0.0)
|
8
|
+
erubis (~> 2.7.0)
|
9
|
+
journey (~> 1.0.4)
|
10
|
+
rack (~> 1.4.0)
|
11
|
+
rack-cache (~> 1.2)
|
12
|
+
rack-test (~> 0.6.1)
|
13
|
+
sprockets (~> 2.2.1)
|
14
|
+
activemodel (3.2.9)
|
15
|
+
activesupport (= 3.2.9)
|
16
|
+
builder (~> 3.0.0)
|
17
|
+
activesupport (3.2.9)
|
18
|
+
i18n (~> 0.6)
|
19
|
+
multi_json (~> 1.0)
|
20
|
+
appraisal (0.5.1)
|
21
|
+
bundler
|
22
|
+
rake
|
23
|
+
builder (3.0.4)
|
24
|
+
bump (0.3.5)
|
25
|
+
diff-lcs (1.1.3)
|
26
|
+
erubis (2.7.0)
|
27
|
+
hike (1.2.1)
|
28
|
+
i18n (0.6.1)
|
29
|
+
journey (1.0.4)
|
30
|
+
multi_json (1.3.7)
|
31
|
+
rack (1.4.1)
|
32
|
+
rack-cache (1.2)
|
33
|
+
rack (>= 0.4)
|
34
|
+
rack-test (0.6.2)
|
35
|
+
rack (>= 1.0)
|
36
|
+
rake (10.0.0)
|
37
|
+
rspec (2.11.0)
|
38
|
+
rspec-core (~> 2.11.0)
|
39
|
+
rspec-expectations (~> 2.11.0)
|
40
|
+
rspec-mocks (~> 2.11.0)
|
41
|
+
rspec-core (2.11.1)
|
42
|
+
rspec-expectations (2.11.3)
|
43
|
+
diff-lcs (~> 1.1.3)
|
44
|
+
rspec-mocks (2.11.3)
|
45
|
+
sprockets (2.2.1)
|
46
|
+
hike (~> 1.2)
|
47
|
+
multi_json (~> 1.0)
|
48
|
+
rack (~> 1.0)
|
49
|
+
tilt (~> 1.1, != 1.3.0)
|
50
|
+
test-unit (2.5.2)
|
51
|
+
tilt (1.3.3)
|
52
|
+
|
53
|
+
PLATFORMS
|
54
|
+
ruby
|
55
|
+
|
56
|
+
DEPENDENCIES
|
57
|
+
actionpack (~> 3.2.0)
|
58
|
+
appraisal
|
59
|
+
bump
|
60
|
+
rake
|
61
|
+
rspec
|
62
|
+
test-unit
|
data/lib/easy_esi.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
|
1
|
+
require "easy_esi/version"
|
3
2
|
|
3
|
+
module EasyEsi
|
4
4
|
def self.include_for(data)
|
5
5
|
%{<esi:include src="#{serialize(data)}"/>}.html_safe
|
6
6
|
end
|
@@ -37,35 +37,25 @@ class ActionView::Base
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
# replace cached includes
|
41
|
-
# cache miss:
|
42
|
-
# filter_with_esi -> filter_without_esi -> after_filter -> filter_with_esi
|
43
|
-
# do not replace <include> in after filter, but after filter_without_esi
|
44
|
-
#
|
45
|
-
# cache hit:
|
46
|
-
# filter_with_esi -> filter_without_esi -> filter_with_esi
|
47
|
-
# after_filter will not be called, but <include> needs to be replaced
|
48
|
-
#
|
49
|
-
class ActionController::Caching::Actions::ActionCacheFilter
|
50
|
-
def filter_with_esi(controller, &block)
|
51
|
-
controller.instance_variable_set "@do_not_replace_esi", true
|
52
|
-
result = filter_without_esi(controller, &block)
|
53
|
-
controller.instance_variable_set "@do_not_replace_esi", false
|
54
|
-
|
55
|
-
controller.send(:render_esi) if controller.esi_enabled
|
56
|
-
|
57
|
-
result
|
58
|
-
end
|
59
|
-
alias_method_chain :filter, :esi
|
60
|
-
end
|
61
|
-
|
62
40
|
class ActionController::Base
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
41
|
+
# replace cached includes
|
42
|
+
# cache miss:
|
43
|
+
# filter_with_esi -> filter_without_esi -> after_filter -> filter_with_esi
|
44
|
+
# do not replace <include> in after filter, but after filter_without_esi
|
45
|
+
#
|
46
|
+
# cache hit:
|
47
|
+
# filter_with_esi -> filter_without_esi -> filter_with_esi
|
48
|
+
# after_filter will not be called, but <include> needs to be replaced
|
49
|
+
around_filter :render_with_esi
|
50
|
+
def render_with_esi
|
51
|
+
@do_not_replace_esi = true
|
52
|
+
yield
|
53
|
+
@do_not_replace_esi = false
|
54
|
+
render_esi if esi_enabled
|
67
55
|
end
|
68
56
|
|
57
|
+
class_attribute :esi_enabled
|
58
|
+
|
69
59
|
def self.enable_esi
|
70
60
|
self.esi_enabled = true
|
71
61
|
after_filter :render_esi
|
data/test/easy_esi_test.rb
CHANGED
@@ -72,7 +72,7 @@ class EsiEnabledController < EsiDisabledController
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def send_a_file
|
75
|
-
send_file "
|
75
|
+
send_file "Rakefile"
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -123,7 +123,7 @@ class EsiEnabledTest < ActionController::TestCase
|
|
123
123
|
|
124
124
|
test "it can send a file" do
|
125
125
|
get :send_a_file
|
126
|
-
@response.body.should
|
126
|
+
@response.body.should =~ /task :default/
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
data/test/test_helper.rb
CHANGED
@@ -4,62 +4,46 @@ require 'active_support/all'
|
|
4
4
|
require 'action_pack'
|
5
5
|
require 'action_controller'
|
6
6
|
require 'test/unit'
|
7
|
-
require 'redgreen'
|
8
7
|
$LOAD_PATH << 'lib'
|
9
|
-
require '
|
8
|
+
require 'easy_esi'
|
10
9
|
|
11
10
|
ActionController::Base.cache_store = :memory_store
|
12
11
|
|
13
|
-
|
14
|
-
require 'action_dispatch/testing/test_process'
|
12
|
+
require 'action_dispatch/testing/test_process'
|
15
13
|
|
16
14
|
# fake checks
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
15
|
+
require 'ostruct'
|
16
|
+
module ActionController::UrlFor
|
17
|
+
def _routes
|
18
|
+
helpers = OpenStruct.new
|
19
|
+
helpers.url_helpers = Module.new
|
20
|
+
helpers
|
24
21
|
end
|
22
|
+
end
|
25
23
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
ROUTES = ActionDispatch::Routing::RouteSet.new
|
25
|
+
ROUTES.draw do
|
26
|
+
match ':controller(/:action(/:id(.:format)))'
|
27
|
+
end
|
28
|
+
ROUTES.finalize!
|
31
29
|
|
32
30
|
# funky patch to get @routes working, in 'setup' did not work
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
alias_method_chain :process, :routes
|
31
|
+
module ActionController::TestCase::Behavior
|
32
|
+
def process_with_routes(*args)
|
33
|
+
@routes = ROUTES
|
34
|
+
process_without_routes(*args)
|
39
35
|
end
|
36
|
+
alias_method_chain :process, :routes
|
37
|
+
end
|
40
38
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
def self._routes
|
45
|
-
ROUTES
|
46
|
-
end
|
39
|
+
class ActionController::Base
|
40
|
+
self.view_paths = 'test/views'
|
47
41
|
|
48
|
-
|
49
|
-
|
50
|
-
end
|
42
|
+
def self._routes
|
43
|
+
ROUTES
|
51
44
|
end
|
52
|
-
else
|
53
|
-
require 'action_controller/test_process'
|
54
|
-
|
55
|
-
ActionController::Routing::Routes.reload rescue nil
|
56
|
-
ActionController::Base.cache_store = :memory_store
|
57
|
-
|
58
|
-
class ActionController::Base
|
59
|
-
before_filter :set_view_paths
|
60
45
|
|
61
|
-
|
62
|
-
|
63
|
-
end
|
46
|
+
def url_for(*args)
|
47
|
+
'xxx'
|
64
48
|
end
|
65
49
|
end
|
metadata
CHANGED
@@ -1,42 +1,60 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_esi
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Michael Grosser
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2012-11-13 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: actionpack
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
23
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 7
|
28
|
+
segments:
|
29
|
+
- 2
|
30
|
+
version: "2"
|
22
31
|
type: :runtime
|
32
|
+
requirement: *id001
|
23
33
|
prerelease: false
|
24
|
-
version_requirements: *74588230
|
25
34
|
description:
|
26
35
|
email: michael@grosser.it
|
27
36
|
executables: []
|
37
|
+
|
28
38
|
extensions: []
|
39
|
+
|
29
40
|
extra_rdoc_files: []
|
30
|
-
|
31
|
-
|
41
|
+
|
42
|
+
files:
|
43
|
+
- .travis.yml
|
44
|
+
- Appraisals
|
32
45
|
- Gemfile
|
33
46
|
- Gemfile.lock
|
34
47
|
- Rakefile
|
35
48
|
- Readme.md
|
36
|
-
- VERSION
|
37
49
|
- easy_esi.gemspec
|
38
|
-
-
|
50
|
+
- gemfiles/rails.3.0.gemfile
|
51
|
+
- gemfiles/rails.3.0.gemfile.lock
|
52
|
+
- gemfiles/rails.3.1.gemfile
|
53
|
+
- gemfiles/rails.3.1.gemfile.lock
|
54
|
+
- gemfiles/rails.3.2.gemfile
|
55
|
+
- gemfiles/rails.3.2.gemfile.lock
|
39
56
|
- lib/easy_esi.rb
|
57
|
+
- lib/easy_esi/version.rb
|
40
58
|
- test/easy_esi_test.rb
|
41
59
|
- test/test_helper.rb
|
42
60
|
- test/views/esi_disabled/_a_partial.erb
|
@@ -49,30 +67,37 @@ files:
|
|
49
67
|
- test/views/esi_enabled/show.erb
|
50
68
|
- test/views/esi_enabled/with_hash.erb
|
51
69
|
homepage: http://github.com/grosser/easy_esi
|
52
|
-
licenses:
|
70
|
+
licenses:
|
71
|
+
- MIT
|
53
72
|
post_install_message:
|
54
73
|
rdoc_options: []
|
55
|
-
|
74
|
+
|
75
|
+
require_paths:
|
56
76
|
- lib
|
57
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
78
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
segments:
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
64
84
|
- 0
|
65
|
-
|
66
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
87
|
none: false
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
72
95
|
requirements: []
|
96
|
+
|
73
97
|
rubyforge_project:
|
74
|
-
rubygems_version: 1.8.
|
98
|
+
rubygems_version: 1.8.24
|
75
99
|
signing_key:
|
76
100
|
specification_version: 3
|
77
|
-
summary:
|
101
|
+
summary: "Rails: Cached pages with updated partials"
|
78
102
|
test_files: []
|
103
|
+
|
data/CHANGELOG
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.0 - new esi include format, expire all caches that use old esi includes
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.3
|
data/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'easy_esi'
|