actionpack-page_caching 1.2.0 → 1.2.4
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/.github/workflows/ci.yml +78 -0
- data/.rubocop.yml +41 -41
- data/CHANGELOG.md +63 -21
- data/README.md +1 -1
- data/actionpack-page_caching.gemspec +3 -3
- data/gemfiles/Gemfile-4-2-stable +5 -0
- data/gemfiles/Gemfile-6-1-stable +5 -0
- data/gemfiles/Gemfile-edge +1 -2
- data/lib/action_controller/caching/pages.rb +13 -2
- data/lib/action_controller/page_caching.rb +1 -5
- data/test/caching_test.rb +26 -1
- metadata +12 -10
- data/.travis.yml +0 -43
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89bc2dc16c419dd0cc85e43d0318d2cf25698aadf2e5b52f79188038a4159bd9
|
|
4
|
+
data.tar.gz: 1ee8bbc284ae4ccf1249648779edd731dd856102886eda5ceffe6827b46c7bbb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c62d167b5f9b06ec6ae84253cab216544d9e887da74b5dc860fc75655bbea488349eb2b85cea21609ad4ce5fd4abe0c815acb09c05d489af968d7f5e8f1a6d52
|
|
7
|
+
data.tar.gz: adb8c87f834ad88955f8c0d8e5282b64a41ac5948e235d923647164d68d30bac56b4ee4b4de50b9d587a0c48e5835981162873c6f59e6e557d2e3af9d86e41e0
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- 'master'
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
gemfile:
|
|
14
|
+
- '4-2-stable'
|
|
15
|
+
- '5-0-stable'
|
|
16
|
+
- '5-1-stable'
|
|
17
|
+
- '5-2-stable'
|
|
18
|
+
- '6-0-stable'
|
|
19
|
+
- '6-1-stable'
|
|
20
|
+
- 'edge'
|
|
21
|
+
ruby:
|
|
22
|
+
- '2.4'
|
|
23
|
+
- '2.5'
|
|
24
|
+
- '2.6'
|
|
25
|
+
- '2.7'
|
|
26
|
+
- '3.0'
|
|
27
|
+
exclude:
|
|
28
|
+
- gemfile: '4-2-stable'
|
|
29
|
+
ruby: '2.5'
|
|
30
|
+
- gemfile: '4-2-stable'
|
|
31
|
+
ruby: '2.6'
|
|
32
|
+
- gemfile: '4-2-stable'
|
|
33
|
+
ruby: '2.7'
|
|
34
|
+
- gemfile: '4-2-stable'
|
|
35
|
+
ruby: '3.0'
|
|
36
|
+
- gemfile: '5-0-stable'
|
|
37
|
+
ruby: '2.7'
|
|
38
|
+
- gemfile: '5-0-stable'
|
|
39
|
+
ruby: '3.0'
|
|
40
|
+
- gemfile: '5-1-stable'
|
|
41
|
+
ruby: '2.7'
|
|
42
|
+
- gemfile: '5-1-stable'
|
|
43
|
+
ruby: '3.0'
|
|
44
|
+
- gemfile: '5-2-stable'
|
|
45
|
+
ruby: '2.7'
|
|
46
|
+
- gemfile: '5-2-stable'
|
|
47
|
+
ruby: '3.0'
|
|
48
|
+
- gemfile: '6-0-stable'
|
|
49
|
+
ruby: '2.4'
|
|
50
|
+
- gemfile: '6-1-stable'
|
|
51
|
+
ruby: '2.4'
|
|
52
|
+
- gemfile: 'edge'
|
|
53
|
+
ruby: '2.4'
|
|
54
|
+
- gemfile: 'edge'
|
|
55
|
+
ruby: '2.5'
|
|
56
|
+
- gemfile: 'edge'
|
|
57
|
+
ruby: '2.6'
|
|
58
|
+
fail-fast: false
|
|
59
|
+
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
name: ${{ matrix.ruby }} rails-${{ matrix.gemfile }}
|
|
62
|
+
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v2
|
|
65
|
+
|
|
66
|
+
- uses: ruby/setup-ruby@v1
|
|
67
|
+
with:
|
|
68
|
+
ruby-version: ${{ matrix.ruby }}
|
|
69
|
+
bundler-cache: true
|
|
70
|
+
bundler: ${{ fromJSON('["2", "1"]')[matrix.ruby == '2.4'] }}
|
|
71
|
+
|
|
72
|
+
- run: bundle exec rake test
|
|
73
|
+
|
|
74
|
+
env:
|
|
75
|
+
BUNDLE_GEMFILE: gemfiles/Gemfile-${{ matrix.gemfile }}
|
|
76
|
+
BUNDLE_JOBS: 4
|
|
77
|
+
BUNDLE_RETRY: 3
|
|
78
|
+
|
data/.rubocop.yml
CHANGED
|
@@ -4,10 +4,6 @@ AllCops:
|
|
|
4
4
|
# to ignore them, so only the ones explicitly set in this file are enabled.
|
|
5
5
|
DisabledByDefault: true
|
|
6
6
|
|
|
7
|
-
# Prefer &&/|| over and/or.
|
|
8
|
-
Style/AndOr:
|
|
9
|
-
Enabled: true
|
|
10
|
-
|
|
11
7
|
# Align `when` with `case`.
|
|
12
8
|
Layout/CaseIndentation:
|
|
13
9
|
Enabled: true
|
|
@@ -22,13 +18,6 @@ Layout/CommentIndentation:
|
|
|
22
18
|
Layout/ElseAlignment:
|
|
23
19
|
Enabled: true
|
|
24
20
|
|
|
25
|
-
# Align `end` with the matching keyword or starting expression except for
|
|
26
|
-
# assignments, where it should be aligned with the LHS.
|
|
27
|
-
Layout/EndAlignment:
|
|
28
|
-
Enabled: true
|
|
29
|
-
EnforcedStyleAlignWith: variable
|
|
30
|
-
AutoCorrect: true
|
|
31
|
-
|
|
32
21
|
Layout/EmptyLineAfterMagicComment:
|
|
33
22
|
Enabled: true
|
|
34
23
|
|
|
@@ -51,9 +40,12 @@ Layout/EmptyLinesAroundMethodBody:
|
|
|
51
40
|
Layout/EmptyLinesAroundModuleBody:
|
|
52
41
|
Enabled: true
|
|
53
42
|
|
|
54
|
-
#
|
|
55
|
-
|
|
43
|
+
# Align `end` with the matching keyword or starting expression except for
|
|
44
|
+
# assignments, where it should be aligned with the LHS.
|
|
45
|
+
Layout/EndAlignment:
|
|
56
46
|
Enabled: true
|
|
47
|
+
EnforcedStyleAlignWith: variable
|
|
48
|
+
AutoCorrect: true
|
|
57
49
|
|
|
58
50
|
Layout/FirstArgumentIndentation:
|
|
59
51
|
Enabled: true
|
|
@@ -86,6 +78,10 @@ Layout/SpaceAroundEqualsInParameterDefault:
|
|
|
86
78
|
Layout/SpaceAroundKeyword:
|
|
87
79
|
Enabled: true
|
|
88
80
|
|
|
81
|
+
# Use `foo {}` not `foo{}`.
|
|
82
|
+
Layout/SpaceBeforeBlockBraces:
|
|
83
|
+
Enabled: true
|
|
84
|
+
|
|
89
85
|
Layout/SpaceBeforeComma:
|
|
90
86
|
Enabled: true
|
|
91
87
|
|
|
@@ -95,20 +91,6 @@ Layout/SpaceBeforeComment:
|
|
|
95
91
|
Layout/SpaceBeforeFirstArg:
|
|
96
92
|
Enabled: true
|
|
97
93
|
|
|
98
|
-
Style/DefWithParentheses:
|
|
99
|
-
Enabled: true
|
|
100
|
-
|
|
101
|
-
# Defining a method with parameters needs parentheses.
|
|
102
|
-
Style/MethodDefParentheses:
|
|
103
|
-
Enabled: true
|
|
104
|
-
|
|
105
|
-
Style/RedundantFreeze:
|
|
106
|
-
Enabled: true
|
|
107
|
-
|
|
108
|
-
# Use `foo {}` not `foo{}`.
|
|
109
|
-
Layout/SpaceBeforeBlockBraces:
|
|
110
|
-
Enabled: true
|
|
111
|
-
|
|
112
94
|
# Use `foo { bar }` not `foo {bar}`.
|
|
113
95
|
Layout/SpaceInsideBlockBraces:
|
|
114
96
|
Enabled: true
|
|
@@ -121,11 +103,6 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
|
121
103
|
Layout/SpaceInsideParens:
|
|
122
104
|
Enabled: true
|
|
123
105
|
|
|
124
|
-
# Check quotes usage according to lint rule below.
|
|
125
|
-
Style/StringLiterals:
|
|
126
|
-
Enabled: true
|
|
127
|
-
EnforcedStyle: double_quotes
|
|
128
|
-
|
|
129
106
|
# Detect hard tabs, no hard tabs.
|
|
130
107
|
Layout/Tab:
|
|
131
108
|
Enabled: true
|
|
@@ -138,19 +115,21 @@ Layout/TrailingEmptyLines:
|
|
|
138
115
|
Layout/TrailingWhitespace:
|
|
139
116
|
Enabled: true
|
|
140
117
|
|
|
141
|
-
# Use quotes for string literals when they are enough.
|
|
142
|
-
Style/RedundantPercentQ:
|
|
143
|
-
Enabled: true
|
|
144
|
-
|
|
145
118
|
Lint/AmbiguousOperator:
|
|
146
119
|
Enabled: true
|
|
147
120
|
|
|
148
121
|
Lint/AmbiguousRegexpLiteral:
|
|
149
122
|
Enabled: true
|
|
150
123
|
|
|
124
|
+
Lint/DeprecatedClassMethods:
|
|
125
|
+
Enabled: true
|
|
126
|
+
|
|
151
127
|
Lint/ErbNewArguments:
|
|
152
128
|
Enabled: true
|
|
153
129
|
|
|
130
|
+
Lint/RedundantStringCoercion:
|
|
131
|
+
Enabled: true
|
|
132
|
+
|
|
154
133
|
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
|
155
134
|
Lint/RequireParentheses:
|
|
156
135
|
Enabled: true
|
|
@@ -158,16 +137,29 @@ Lint/RequireParentheses:
|
|
|
158
137
|
Lint/ShadowingOuterLocalVariable:
|
|
159
138
|
Enabled: true
|
|
160
139
|
|
|
161
|
-
Lint/
|
|
140
|
+
Lint/UselessAssignment:
|
|
162
141
|
Enabled: true
|
|
163
142
|
|
|
164
143
|
Lint/UriEscapeUnescape:
|
|
165
144
|
Enabled: true
|
|
166
145
|
|
|
167
|
-
|
|
146
|
+
# Prefer &&/|| over and/or.
|
|
147
|
+
Style/AndOr:
|
|
168
148
|
Enabled: true
|
|
169
149
|
|
|
170
|
-
|
|
150
|
+
# Prefer Foo.method over Foo::method
|
|
151
|
+
Style/ColonMethodCall:
|
|
152
|
+
Enabled: true
|
|
153
|
+
|
|
154
|
+
Style/DefWithParentheses:
|
|
155
|
+
Enabled: true
|
|
156
|
+
|
|
157
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
|
158
|
+
Style/HashSyntax:
|
|
159
|
+
Enabled: true
|
|
160
|
+
|
|
161
|
+
# Defining a method with parameters needs parentheses.
|
|
162
|
+
Style/MethodDefParentheses:
|
|
171
163
|
Enabled: true
|
|
172
164
|
|
|
173
165
|
Style/ParenthesesAroundCondition:
|
|
@@ -176,6 +168,13 @@ Style/ParenthesesAroundCondition:
|
|
|
176
168
|
Style/RedundantBegin:
|
|
177
169
|
Enabled: true
|
|
178
170
|
|
|
171
|
+
Style/RedundantFreeze:
|
|
172
|
+
Enabled: true
|
|
173
|
+
|
|
174
|
+
# Use quotes for string literals when they are enough.
|
|
175
|
+
Style/RedundantPercentQ:
|
|
176
|
+
Enabled: true
|
|
177
|
+
|
|
179
178
|
Style/RedundantReturn:
|
|
180
179
|
Enabled: true
|
|
181
180
|
AllowMultipleReturnValues: true
|
|
@@ -184,9 +183,10 @@ Style/Semicolon:
|
|
|
184
183
|
Enabled: true
|
|
185
184
|
AllowAsExpressionSeparator: true
|
|
186
185
|
|
|
187
|
-
#
|
|
188
|
-
Style/
|
|
186
|
+
# Check quotes usage according to lint rule below.
|
|
187
|
+
Style/StringLiterals:
|
|
189
188
|
Enabled: true
|
|
189
|
+
EnforcedStyle: double_quotes
|
|
190
190
|
|
|
191
191
|
Style/TrivialAccessors:
|
|
192
192
|
Enabled: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,47 +1,89 @@
|
|
|
1
|
-
## 1.
|
|
1
|
+
## 1.2.4 (May 15, 2021)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
- Fix `URI.parser` deprecation warning in Rails 6.1
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
_Andrew White_
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 1.2.3 (June 12, 2020)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- Simplifies code in `page_caching.rb`
|
|
10
10
|
|
|
11
|
+
_Xavier Noria_
|
|
11
12
|
|
|
12
|
-
## 1.
|
|
13
|
+
## 1.2.2 (May 6, 2020)
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
- Fix variable name
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
_Jack McCracken_
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
## 1.2.1 (May 6, 2020)
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
- Only write relative URIs when their normalized path begins with the normalized cache directory path
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
_Jack McCracken_
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
## 1.2.0 (December 11, 2019)
|
|
25
26
|
|
|
27
|
+
- Update RuboCop config
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
_Rafael Mendonça França_
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
- Fix for Rails 6 MIME lookups
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
_Rob Zolkos_
|
|
32
34
|
|
|
35
|
+
- Remove Rails 4.2 from testing matrix
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
_Rob Zolkos_
|
|
38
|
+
|
|
39
|
+
- Minimum of Ruby 2.4 required
|
|
40
|
+
|
|
41
|
+
_Rob Zolkos_
|
|
42
|
+
|
|
43
|
+
- Remove upper dependency for `actionpack`
|
|
44
|
+
|
|
45
|
+
_Anton Kolodii_
|
|
46
|
+
|
|
47
|
+
## 1.1.1 (September 25, 2018)
|
|
48
|
+
|
|
49
|
+
- Fixes handling of several forward slashes as root path
|
|
50
|
+
|
|
51
|
+
_Xavier Noria_
|
|
52
|
+
|
|
53
|
+
- Documentation overhaul
|
|
54
|
+
|
|
55
|
+
_Xavier Noria_
|
|
35
56
|
|
|
36
|
-
|
|
57
|
+
## 1.1.0 (January 23, 2017)
|
|
58
|
+
|
|
59
|
+
- Support dynamic `page_cache_directory` using a Proc, Symbol or callable
|
|
60
|
+
|
|
61
|
+
_Andrew White_
|
|
62
|
+
|
|
63
|
+
- Support instance level setting of `page_cache_directory`
|
|
64
|
+
|
|
65
|
+
_Andrew White_
|
|
66
|
+
|
|
67
|
+
- Add support for Rails 5.0 and master
|
|
68
|
+
|
|
69
|
+
_Andrew White_
|
|
70
|
+
|
|
71
|
+
## 1.0.2 (November 15, 2013)
|
|
72
|
+
|
|
73
|
+
- Fix load order problem with other gems.
|
|
74
|
+
|
|
75
|
+
_Rafael Mendonça França_
|
|
76
|
+
|
|
77
|
+
## 1.0.1 (October 24, 2013)
|
|
37
78
|
|
|
38
|
-
|
|
79
|
+
- Add Railtie to set `page_cache_directory` by default to `public` folder.
|
|
39
80
|
|
|
40
|
-
|
|
81
|
+
Fixes #5.
|
|
41
82
|
|
|
83
|
+
_Žiga Vidic_
|
|
42
84
|
|
|
43
85
|
## 1.0.0 (February 27, 2013)
|
|
44
86
|
|
|
45
|
-
|
|
87
|
+
- Extract Action Pack - Action Caching from Rails core.
|
|
46
88
|
|
|
47
|
-
|
|
89
|
+
_Francesco Rodriguez_, _Rafael Mendonça França_, _Michiel Sikkes_
|
data/README.md
CHANGED
|
@@ -212,4 +212,4 @@ Contributing
|
|
|
212
212
|
Code Status
|
|
213
213
|
-----------
|
|
214
214
|
|
|
215
|
-
* [](https://github.com/rails/actionpack-page_caching/actions/workflows/ci.yml)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |gem|
|
|
2
2
|
gem.name = "actionpack-page_caching"
|
|
3
|
-
gem.version = "1.2.
|
|
3
|
+
gem.version = "1.2.4"
|
|
4
4
|
gem.author = "David Heinemeier Hansson"
|
|
5
5
|
gem.email = "david@loudthinking.com"
|
|
6
6
|
gem.description = "Static page caching for Action Pack (removed from core in Rails 4.0)"
|
|
@@ -8,14 +8,14 @@ Gem::Specification.new do |gem|
|
|
|
8
8
|
gem.homepage = "https://github.com/rails/actionpack-page_caching"
|
|
9
9
|
gem.license = "MIT"
|
|
10
10
|
|
|
11
|
-
gem.required_ruby_version = ">=
|
|
11
|
+
gem.required_ruby_version = ">= 1.9.3"
|
|
12
12
|
gem.files = `git ls-files`.split($/)
|
|
13
13
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
|
14
14
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
15
15
|
gem.require_paths = ["lib"]
|
|
16
16
|
gem.license = "MIT"
|
|
17
17
|
|
|
18
|
-
gem.add_dependency "actionpack", ">=
|
|
18
|
+
gem.add_dependency "actionpack", ">= 4.0.0"
|
|
19
19
|
|
|
20
20
|
gem.add_development_dependency "mocha"
|
|
21
21
|
end
|
data/gemfiles/Gemfile-edge
CHANGED
|
@@ -93,6 +93,10 @@ module ActionController
|
|
|
93
93
|
end
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
+
def normalized_cache_directory
|
|
97
|
+
File.expand_path(cache_directory)
|
|
98
|
+
end
|
|
99
|
+
|
|
96
100
|
def handle_proc_cache_directory
|
|
97
101
|
if @controller
|
|
98
102
|
@controller.instance_exec(&@cache_directory)
|
|
@@ -142,7 +146,7 @@ module ActionController
|
|
|
142
146
|
if path.empty? || path =~ %r{\A/+\z}
|
|
143
147
|
name = "/index"
|
|
144
148
|
else
|
|
145
|
-
name = URI.
|
|
149
|
+
name = URI::DEFAULT_PARSER.unescape(path.chomp("/"))
|
|
146
150
|
end
|
|
147
151
|
|
|
148
152
|
if File.extname(name).empty?
|
|
@@ -153,15 +157,22 @@ module ActionController
|
|
|
153
157
|
end
|
|
154
158
|
|
|
155
159
|
def cache_path(path, extension = nil)
|
|
156
|
-
File.join(
|
|
160
|
+
unnormalized_path = File.join(normalized_cache_directory, cache_file(path, extension))
|
|
161
|
+
normalized_path = File.expand_path(unnormalized_path)
|
|
162
|
+
|
|
163
|
+
normalized_path if normalized_path.start_with?(normalized_cache_directory)
|
|
157
164
|
end
|
|
158
165
|
|
|
159
166
|
def delete(path)
|
|
167
|
+
return unless path
|
|
168
|
+
|
|
160
169
|
File.delete(path) if File.exist?(path)
|
|
161
170
|
File.delete(path + ".gz") if File.exist?(path + ".gz")
|
|
162
171
|
end
|
|
163
172
|
|
|
164
173
|
def write(content, path, gzip)
|
|
174
|
+
return unless path
|
|
175
|
+
|
|
165
176
|
FileUtils.makedirs(File.dirname(path))
|
|
166
177
|
File.open(path, "wb+") { |f| f.write(content) }
|
|
167
178
|
|
|
@@ -2,12 +2,8 @@ require "action_controller/caching/pages"
|
|
|
2
2
|
|
|
3
3
|
module ActionController
|
|
4
4
|
module Caching
|
|
5
|
-
eager_autoload do
|
|
6
|
-
autoload :Pages
|
|
7
|
-
end
|
|
8
|
-
|
|
9
5
|
include Pages
|
|
10
6
|
end
|
|
11
7
|
end
|
|
12
8
|
|
|
13
|
-
ActionController::Base.
|
|
9
|
+
ActionController::Base.include(ActionController::Caching::Pages)
|
data/test/caching_test.rb
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
require "rails/version"
|
|
1
2
|
require "abstract_unit"
|
|
2
|
-
require "mocha/
|
|
3
|
+
require "mocha/minitest"
|
|
4
|
+
require "find"
|
|
3
5
|
|
|
4
6
|
CACHE_DIR = "test_cache"
|
|
5
7
|
# Don't change "../tmp" cavalierly or you might hose something you don't want hosed
|
|
6
8
|
TEST_TMP_DIR = File.expand_path("../tmp", __FILE__)
|
|
7
9
|
FILE_STORE_PATH = File.join(TEST_TMP_DIR, CACHE_DIR)
|
|
8
10
|
|
|
11
|
+
|
|
9
12
|
module PageCachingTestHelpers
|
|
10
13
|
def setup
|
|
11
14
|
super
|
|
@@ -175,6 +178,28 @@ class PageCachingTest < ActionController::TestCase
|
|
|
175
178
|
include PageCachingTestHelpers
|
|
176
179
|
tests PageCachingTestController
|
|
177
180
|
|
|
181
|
+
def test_cache_does_not_escape
|
|
182
|
+
draw do
|
|
183
|
+
get "/page_caching_test/ok/:id", to: "page_caching_test#ok"
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
project_root = File.expand_path("../../", __FILE__)
|
|
187
|
+
|
|
188
|
+
# Make a path that escapes the cache directory
|
|
189
|
+
get_to_root = "../../../"
|
|
190
|
+
|
|
191
|
+
# Make sure this relative path points at the project root
|
|
192
|
+
assert_equal project_root, File.expand_path(File.join(FILE_STORE_PATH, get_to_root))
|
|
193
|
+
|
|
194
|
+
if Rails.version =~ /^4\./
|
|
195
|
+
get :ok, id: "#{get_to_root}../pwnd"
|
|
196
|
+
else
|
|
197
|
+
get :ok, params: { id: "#{get_to_root}../pwnd" }
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
assert_predicate Find.find(File.join(project_root, "test")).grep(/pwnd/), :empty?
|
|
201
|
+
end
|
|
202
|
+
|
|
178
203
|
def test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route
|
|
179
204
|
draw do
|
|
180
205
|
get "posts.:format", to: "posts#index", as: :formatted_posts
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: actionpack-page_caching
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 4.0.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 4.0.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: mocha
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -45,19 +45,21 @@ extensions: []
|
|
|
45
45
|
extra_rdoc_files: []
|
|
46
46
|
files:
|
|
47
47
|
- ".codeclimate.yml"
|
|
48
|
+
- ".github/workflows/ci.yml"
|
|
48
49
|
- ".gitignore"
|
|
49
50
|
- ".rubocop.yml"
|
|
50
|
-
- ".travis.yml"
|
|
51
51
|
- CHANGELOG.md
|
|
52
52
|
- Gemfile
|
|
53
53
|
- LICENSE.txt
|
|
54
54
|
- README.md
|
|
55
55
|
- Rakefile
|
|
56
56
|
- actionpack-page_caching.gemspec
|
|
57
|
+
- gemfiles/Gemfile-4-2-stable
|
|
57
58
|
- gemfiles/Gemfile-5-0-stable
|
|
58
59
|
- gemfiles/Gemfile-5-1-stable
|
|
59
60
|
- gemfiles/Gemfile-5-2-stable
|
|
60
61
|
- gemfiles/Gemfile-6-0-stable
|
|
62
|
+
- gemfiles/Gemfile-6-1-stable
|
|
61
63
|
- gemfiles/Gemfile-edge
|
|
62
64
|
- lib/action_controller/caching/pages.rb
|
|
63
65
|
- lib/action_controller/page_caching.rb
|
|
@@ -70,7 +72,7 @@ homepage: https://github.com/rails/actionpack-page_caching
|
|
|
70
72
|
licenses:
|
|
71
73
|
- MIT
|
|
72
74
|
metadata: {}
|
|
73
|
-
post_install_message:
|
|
75
|
+
post_install_message:
|
|
74
76
|
rdoc_options: []
|
|
75
77
|
require_paths:
|
|
76
78
|
- lib
|
|
@@ -78,15 +80,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
78
80
|
requirements:
|
|
79
81
|
- - ">="
|
|
80
82
|
- !ruby/object:Gem::Version
|
|
81
|
-
version:
|
|
83
|
+
version: 1.9.3
|
|
82
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
85
|
requirements:
|
|
84
86
|
- - ">="
|
|
85
87
|
- !ruby/object:Gem::Version
|
|
86
88
|
version: '0'
|
|
87
89
|
requirements: []
|
|
88
|
-
rubygems_version: 3.
|
|
89
|
-
signing_key:
|
|
90
|
+
rubygems_version: 3.2.15
|
|
91
|
+
signing_key:
|
|
90
92
|
specification_version: 4
|
|
91
93
|
summary: Static page caching for Action Pack (removed from core in Rails 4.0)
|
|
92
94
|
test_files:
|
data/.travis.yml
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
sudo: false
|
|
3
|
-
|
|
4
|
-
cache:
|
|
5
|
-
bundler: true
|
|
6
|
-
|
|
7
|
-
before_install:
|
|
8
|
-
- gem install bundler
|
|
9
|
-
|
|
10
|
-
rvm:
|
|
11
|
-
- 2.4.6
|
|
12
|
-
- 2.5.5
|
|
13
|
-
- 2.6.3
|
|
14
|
-
|
|
15
|
-
gemfile:
|
|
16
|
-
- Gemfile
|
|
17
|
-
- gemfiles/Gemfile-5-0-stable
|
|
18
|
-
- gemfiles/Gemfile-5-1-stable
|
|
19
|
-
- gemfiles/Gemfile-5-2-stable
|
|
20
|
-
- gemfiles/Gemfile-6-0-stable
|
|
21
|
-
- gemfiles/Gemfile-edge
|
|
22
|
-
|
|
23
|
-
matrix:
|
|
24
|
-
allow_failures:
|
|
25
|
-
- gemfile: gemfiles/Gemfile-edge
|
|
26
|
-
exclude:
|
|
27
|
-
- rvm: 2.4.6
|
|
28
|
-
gemfile: gemfiles/Gemfile-6-0-stable
|
|
29
|
-
- rvm: 2.4.6
|
|
30
|
-
gemfile: gemfiles/Gemfile-edge
|
|
31
|
-
|
|
32
|
-
notifications:
|
|
33
|
-
email: false
|
|
34
|
-
irc:
|
|
35
|
-
on_success: change
|
|
36
|
-
on_failure: always
|
|
37
|
-
channels:
|
|
38
|
-
- "irc.freenode.org#rails-contrib"
|
|
39
|
-
campfire:
|
|
40
|
-
on_success: change
|
|
41
|
-
on_failure: always
|
|
42
|
-
rooms:
|
|
43
|
-
- secure: "eRCx+FMvH50pmLu0GZTF7NN+2X+CesgodYUlHvCr5EXQ0ZO/YUmeW8vAh/N8\njSrLWYpk/4P/JA63JGWsvFor/zpkTnfwzX3LWgw04GV0V3T9jsn9CD2Coiu6\nFll5u4fUCUwpfbB4RlCkjvFdQmW+F9mmbRGMCDO5CmuPHOyyPH0="
|