actionpack-page_caching 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack-page_caching might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.codeclimate.yml +7 -0
- data/.gitignore +3 -15
- data/.rubocop.yml +116 -0
- data/.travis.yml +39 -0
- data/CHANGELOG.md +31 -6
- data/Gemfile +2 -2
- data/README.md +62 -17
- data/Rakefile +5 -5
- data/actionpack-page_caching.gemspec +14 -13
- data/gemfiles/Gemfile-4-0-stable +4 -3
- data/gemfiles/Gemfile-4-1-stable +6 -0
- data/gemfiles/Gemfile-4-2-stable +10 -0
- data/gemfiles/Gemfile-5-0-stable +5 -0
- data/gemfiles/Gemfile-edge +4 -3
- data/lib/action_controller/caching/pages.rb +182 -76
- data/lib/action_controller/page_caching.rb +1 -1
- data/lib/actionpack/page_caching.rb +1 -1
- data/lib/actionpack/page_caching/railtie.rb +5 -5
- data/test/abstract_unit.rb +9 -19
- data/test/caching_test.rb +345 -86
- data/test/log_subscriber_test.rb +20 -17
- metadata +23 -17
data/test/log_subscriber_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "abstract_unit"
|
2
|
+
require "active_support/log_subscriber/test_helper"
|
3
|
+
require "action_controller/log_subscriber"
|
4
4
|
|
5
5
|
module Another
|
6
6
|
class LogSubscribersController < ActionController::Base
|
@@ -9,8 +9,8 @@ module Another
|
|
9
9
|
self.perform_caching = true
|
10
10
|
|
11
11
|
def with_page_cache
|
12
|
-
cache_page(
|
13
|
-
|
12
|
+
cache_page("Super soaker", "/index.html")
|
13
|
+
head :ok
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -22,12 +22,9 @@ class ACLogSubscriberTest < ActionController::TestCase
|
|
22
22
|
def setup
|
23
23
|
super
|
24
24
|
|
25
|
-
@routes =
|
26
|
-
@routes.draw do
|
27
|
-
get ':controller(/:action)'
|
28
|
-
end
|
25
|
+
@routes = ActionDispatch::Routing::RouteSet.new
|
29
26
|
|
30
|
-
@cache_path = File.expand_path(
|
27
|
+
@cache_path = File.expand_path("../tmp/test_cache", __FILE__)
|
31
28
|
ActionController::Base.page_cache_directory = @cache_path
|
32
29
|
@controller.cache_store = :file_store, @cache_path
|
33
30
|
ActionController::LogSubscriber.attach_to :action_controller
|
@@ -43,12 +40,18 @@ class ACLogSubscriberTest < ActionController::TestCase
|
|
43
40
|
end
|
44
41
|
|
45
42
|
def test_with_page_cache
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
43
|
+
with_routing do |set|
|
44
|
+
set.draw do
|
45
|
+
get "/with_page_cache", to: "another/log_subscribers#with_page_cache"
|
46
|
+
end
|
47
|
+
|
48
|
+
get :with_page_cache
|
49
|
+
wait
|
50
|
+
|
51
|
+
logs = @logger.logged(:info)
|
52
|
+
assert_equal 3, logs.size
|
53
|
+
assert_match(/Write page/, logs[1])
|
54
|
+
assert_match(/\/index\.html/, logs[1])
|
55
|
+
end
|
53
56
|
end
|
54
57
|
end
|
metadata
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack-page_caching
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.0.0
|
20
|
-
- - <
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '6'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 4.0.0
|
30
|
-
- - <
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '6'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: mocha
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
description: Static page caching for Action Pack (removed from core in Rails 4.0)
|
@@ -50,8 +50,10 @@ executables: []
|
|
50
50
|
extensions: []
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
|
-
- .
|
54
|
-
- .
|
53
|
+
- ".codeclimate.yml"
|
54
|
+
- ".gitignore"
|
55
|
+
- ".rubocop.yml"
|
56
|
+
- ".travis.yml"
|
55
57
|
- CHANGELOG.md
|
56
58
|
- Gemfile
|
57
59
|
- LICENSE.txt
|
@@ -59,6 +61,9 @@ files:
|
|
59
61
|
- Rakefile
|
60
62
|
- actionpack-page_caching.gemspec
|
61
63
|
- gemfiles/Gemfile-4-0-stable
|
64
|
+
- gemfiles/Gemfile-4-1-stable
|
65
|
+
- gemfiles/Gemfile-4-2-stable
|
66
|
+
- gemfiles/Gemfile-5-0-stable
|
62
67
|
- gemfiles/Gemfile-edge
|
63
68
|
- lib/action_controller/caching/pages.rb
|
64
69
|
- lib/action_controller/page_caching.rb
|
@@ -68,7 +73,8 @@ files:
|
|
68
73
|
- test/caching_test.rb
|
69
74
|
- test/log_subscriber_test.rb
|
70
75
|
homepage: https://github.com/rails/actionpack-page_caching
|
71
|
-
licenses:
|
76
|
+
licenses:
|
77
|
+
- MIT
|
72
78
|
metadata: {}
|
73
79
|
post_install_message:
|
74
80
|
rdoc_options: []
|
@@ -76,17 +82,17 @@ require_paths:
|
|
76
82
|
- lib
|
77
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
78
84
|
requirements:
|
79
|
-
- -
|
85
|
+
- - ">="
|
80
86
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
87
|
+
version: 1.9.3
|
82
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
89
|
requirements:
|
84
|
-
- -
|
90
|
+
- - ">="
|
85
91
|
- !ruby/object:Gem::Version
|
86
92
|
version: '0'
|
87
93
|
requirements: []
|
88
94
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.6.8
|
90
96
|
signing_key:
|
91
97
|
specification_version: 4
|
92
98
|
summary: Static page caching for Action Pack (removed from core in Rails 4.0)
|