actionpack-page_caching 1.1.1 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4a8baf2e26a08aa06aabc67d4783382223dbef4c
4
- data.tar.gz: '081b862c7762f68baa7ca15a9358689773616bb0'
2
+ SHA256:
3
+ metadata.gz: 92965e865a7dfa9dcb0c95f6ccbe2e6a67368eab493c5d6187ecf433cdade0d4
4
+ data.tar.gz: 5ac29afdd687929ae4a4d1d22b7f58f60663e71c9a07df415ca16fc863c38a2d
5
5
  SHA512:
6
- metadata.gz: 62aca2629984d4538f10ed0cad44265e91238f231cdd071fb36875a35e6607f547ab69aa33cf7e45c87b05677db69f777682cd2324de6c4a3de133e922fe8aa6
7
- data.tar.gz: 7b354f5a3fc117733b5f92228bae747730dda7c70293aa60e7ea8e337c449897f5fa3e2a36179f8b8b409ebd5ff40ee360ba9a7ffb147bd46c71e2431089a15f
6
+ metadata.gz: 8d854ecd63f9ac358593acc46915e2615e8681408dee8c04ee97b34f21d692c9200a6b249cb02f2d4e59a1258c7f030ca73ee700ca7d5c5f6d9156749fe08d79
7
+ data.tar.gz: b5c41eb6c92adb0ea3db3f1ac8b250b739e5119aa006a74dce7ab54ac9921be6d9437ed49ffec702c5fce8e78edb056f23f81b190b7d1bf36522549f1fbdc93b
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.2
2
+ TargetRubyVersion: 2.4
3
3
  # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
4
  # to ignore them, so only the ones explicitly set in this file are enabled.
5
5
  DisabledByDefault: true
@@ -8,80 +8,117 @@ AllCops:
8
8
  Style/AndOr:
9
9
  Enabled: true
10
10
 
11
- # Do not use braces for hash literals when they are the last argument of a
12
- # method call.
13
- Style/BracesAroundHashParameters:
11
+ # Align `when` with `case`.
12
+ Layout/CaseIndentation:
14
13
  Enabled: true
15
14
 
16
- # Align `when` with `case`.
17
- Style/CaseIndentation:
15
+ Layout/ClosingHeredocIndentation:
18
16
  Enabled: true
19
17
 
20
18
  # Align comments with method definitions.
21
- Style/CommentIndentation:
19
+ Layout/CommentIndentation:
20
+ Enabled: true
21
+
22
+ Layout/ElseAlignment:
23
+ Enabled: true
24
+
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
+ Layout/EmptyLineAfterMagicComment:
22
33
  Enabled: true
23
34
 
24
- # No extra empty lines.
25
- Style/EmptyLines:
35
+ Layout/EmptyLinesAroundAccessModifier:
36
+ Enabled: true
37
+ EnforcedStyle: only_before
38
+
39
+ Layout/EmptyLinesAroundBlockBody:
26
40
  Enabled: true
27
41
 
28
42
  # In a regular class definition, no empty lines around the body.
29
- Style/EmptyLinesAroundClassBody:
43
+ Layout/EmptyLinesAroundClassBody:
44
+ Enabled: true
45
+
46
+ # In a regular method definition, no empty lines around the body.
47
+ Layout/EmptyLinesAroundMethodBody:
30
48
  Enabled: true
31
49
 
32
50
  # In a regular module definition, no empty lines around the body.
33
- Style/EmptyLinesAroundModuleBody:
51
+ Layout/EmptyLinesAroundModuleBody:
34
52
  Enabled: true
35
53
 
36
54
  # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
37
55
  Style/HashSyntax:
38
56
  Enabled: true
39
57
 
58
+ Layout/FirstArgumentIndentation:
59
+ Enabled: true
60
+
40
61
  # Method definitions after `private` or `protected` isolated calls need one
41
62
  # extra level of indentation.
42
- Style/IndentationConsistency:
63
+ Layout/IndentationConsistency:
43
64
  Enabled: true
44
- EnforcedStyle: rails
65
+ EnforcedStyle: indented_internal_methods
45
66
 
46
67
  # Two spaces, no tabs (for indentation).
47
- Style/IndentationWidth:
68
+ Layout/IndentationWidth:
69
+ Enabled: true
70
+
71
+ Layout/LeadingCommentSpace:
72
+ Enabled: true
73
+
74
+ Layout/SpaceAfterColon:
75
+ Enabled: true
76
+
77
+ Layout/SpaceAfterComma:
78
+ Enabled: true
79
+
80
+ Layout/SpaceAfterSemicolon:
48
81
  Enabled: true
49
82
 
50
- Style/SpaceAfterColon:
83
+ Layout/SpaceAroundEqualsInParameterDefault:
51
84
  Enabled: true
52
85
 
53
- Style/SpaceAfterComma:
86
+ Layout/SpaceAroundKeyword:
54
87
  Enabled: true
55
88
 
56
- Style/SpaceAroundEqualsInParameterDefault:
89
+ Layout/SpaceBeforeComma:
57
90
  Enabled: true
58
91
 
59
- Style/SpaceAroundKeyword:
92
+ Layout/SpaceBeforeComment:
60
93
  Enabled: true
61
94
 
62
- Style/SpaceAroundOperators:
95
+ Layout/SpaceBeforeFirstArg:
63
96
  Enabled: true
64
97
 
65
- Style/SpaceBeforeFirstArg:
66
- Enabled: true
98
+ Style/DefWithParentheses:
99
+ Enabled: true
67
100
 
68
101
  # Defining a method with parameters needs parentheses.
69
102
  Style/MethodDefParentheses:
70
103
  Enabled: true
71
104
 
105
+ Style/RedundantFreeze:
106
+ Enabled: true
107
+
72
108
  # Use `foo {}` not `foo{}`.
73
- Style/SpaceBeforeBlockBraces:
109
+ Layout/SpaceBeforeBlockBraces:
74
110
  Enabled: true
75
111
 
76
112
  # Use `foo { bar }` not `foo {bar}`.
77
- Style/SpaceInsideBlockBraces:
113
+ Layout/SpaceInsideBlockBraces:
78
114
  Enabled: true
115
+ EnforcedStyleForEmptyBraces: space
79
116
 
80
117
  # Use `{ a: 1 }` not `{a:1}`.
81
- Style/SpaceInsideHashLiteralBraces:
118
+ Layout/SpaceInsideHashLiteralBraces:
82
119
  Enabled: true
83
120
 
84
- Style/SpaceInsideParens:
121
+ Layout/SpaceInsideParens:
85
122
  Enabled: true
86
123
 
87
124
  # Check quotes usage according to lint rule below.
@@ -90,27 +127,66 @@ Style/StringLiterals:
90
127
  EnforcedStyle: double_quotes
91
128
 
92
129
  # Detect hard tabs, no hard tabs.
93
- Style/Tab:
130
+ Layout/Tab:
94
131
  Enabled: true
95
132
 
96
- # Blank lines should not have any spaces.
97
- Style/TrailingBlankLines:
133
+ # Empty lines should not have any spaces.
134
+ Layout/TrailingEmptyLines:
98
135
  Enabled: true
99
136
 
100
137
  # No trailing whitespace.
101
- Style/TrailingWhitespace:
138
+ Layout/TrailingWhitespace:
102
139
  Enabled: true
103
140
 
104
141
  # Use quotes for string literals when they are enough.
105
- Style/UnneededPercentQ:
142
+ Style/RedundantPercentQ:
106
143
  Enabled: true
107
144
 
108
- # Align `end` with the matching keyword or starting expression except for
109
- # assignments, where it should be aligned with the LHS.
110
- Lint/EndAlignment:
145
+ Lint/AmbiguousOperator:
146
+ Enabled: true
147
+
148
+ Lint/AmbiguousRegexpLiteral:
149
+ Enabled: true
150
+
151
+ Lint/ErbNewArguments:
111
152
  Enabled: true
112
- AlignWith: variable
113
153
 
114
154
  # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
115
155
  Lint/RequireParentheses:
116
156
  Enabled: true
157
+
158
+ Lint/ShadowingOuterLocalVariable:
159
+ Enabled: true
160
+
161
+ Lint/RedundantStringCoercion:
162
+ Enabled: true
163
+
164
+ Lint/UriEscapeUnescape:
165
+ Enabled: true
166
+
167
+ Lint/UselessAssignment:
168
+ Enabled: true
169
+
170
+ Lint/DeprecatedClassMethods:
171
+ Enabled: true
172
+
173
+ Style/ParenthesesAroundCondition:
174
+ Enabled: true
175
+
176
+ Style/RedundantBegin:
177
+ Enabled: true
178
+
179
+ Style/RedundantReturn:
180
+ Enabled: true
181
+ AllowMultipleReturnValues: true
182
+
183
+ Style/Semicolon:
184
+ Enabled: true
185
+ AllowAsExpressionSeparator: true
186
+
187
+ # Prefer Foo.method over Foo::method
188
+ Style/ColonMethodCall:
189
+ Enabled: true
190
+
191
+ Style/TrivialAccessors:
192
+ Enabled: true
@@ -8,47 +8,26 @@ before_install:
8
8
  - gem install bundler
9
9
 
10
10
  rvm:
11
- - 1.9.3
12
- - 2.0.0
13
- - 2.1.9
14
- - 2.2.6
15
- - 2.3.3
16
- - 2.4.0
11
+ - 2.4.6
12
+ - 2.5.5
13
+ - 2.6.3
17
14
 
18
15
  gemfile:
19
16
  - Gemfile
20
- - gemfiles/Gemfile-4-0-stable
21
- - gemfiles/Gemfile-4-1-stable
22
- - gemfiles/Gemfile-4-2-stable
23
17
  - gemfiles/Gemfile-5-0-stable
18
+ - gemfiles/Gemfile-5-1-stable
19
+ - gemfiles/Gemfile-5-2-stable
20
+ - gemfiles/Gemfile-6-0-stable
24
21
  - gemfiles/Gemfile-edge
25
22
 
26
23
  matrix:
27
24
  allow_failures:
28
25
  - gemfile: gemfiles/Gemfile-edge
29
26
  exclude:
30
- - rvm: 1.9.3
31
- gemfile: Gemfile
32
- - rvm: 2.0.0
33
- gemfile: Gemfile
34
- - rvm: 2.1.9
35
- gemfile: Gemfile
36
- - rvm: 1.9.3
37
- gemfile: gemfiles/Gemfile-5-0-stable
38
- - rvm: 2.0.0
39
- gemfile: gemfiles/Gemfile-5-0-stable
40
- - rvm: 2.1.9
41
- gemfile: gemfiles/Gemfile-5-0-stable
42
- - rvm: 1.9.3
27
+ - rvm: 2.4.6
28
+ gemfile: gemfiles/Gemfile-6-0-stable
29
+ - rvm: 2.4.6
43
30
  gemfile: gemfiles/Gemfile-edge
44
- - rvm: 2.0.0
45
- gemfile: gemfiles/Gemfile-edge
46
- - rvm: 2.1.9
47
- gemfile: gemfiles/Gemfile-edge
48
- - rvm: 2.4.0
49
- gemfile: gemfiles/Gemfile-4-0-stable
50
- - rvm: 2.4.0
51
- gemfile: gemfiles/Gemfile-4-1-stable
52
31
 
53
32
  notifications:
54
33
  email: false
data/Gemfile CHANGED
@@ -3,3 +3,4 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem "rails"
6
+ gem "rubocop", ">= 0.77.0", require: false
data/README.md CHANGED
@@ -11,7 +11,7 @@ files that the web server can serve directly:
11
11
  2. Its response is calculated and stored in a file _F_.
12
12
  3. Next time _E_ is requested, the web server sends _F_ directly.
13
13
 
14
- That applies only to GET or HEAD requests whose reponse code is 200, the rest
14
+ That applies only to GET or HEAD requests whose response code is 200, the rest
15
15
  are ignored.
16
16
 
17
17
  Unlike caching proxies or other more sophisticated setups, page caching results
@@ -213,4 +213,3 @@ Code Status
213
213
  -----------
214
214
 
215
215
  * [![Build Status](https://travis-ci.org/rails/actionpack-page_caching.svg?branch=master)](https://travis-ci.org/rails/actionpack-page_caching)
216
- * [![Dependency Status](https://gemnasium.com/rails/actionpack-page_caching.svg)](https://gemnasium.com/rails/actionpack-page_caching)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "actionpack-page_caching"
3
- gem.version = "1.1.1"
3
+ gem.version = "1.2.0"
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 = '>= 1.9.3'
11
+ gem.required_ruby_version = ">= 2.4.6"
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
- gem.license = 'MIT'
16
+ gem.license = "MIT"
17
17
 
18
- gem.add_dependency "actionpack", ">= 4.0.0", "< 6"
18
+ gem.add_dependency "actionpack", ">= 5.0.0"
19
19
 
20
20
  gem.add_development_dependency "mocha"
21
21
  end
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", github: "rails/rails", branch: "5-1-stable"
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", github: "rails/rails", branch: "5-2-stable"
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", github: "rails/rails", branch: "6-0-stable"
@@ -136,9 +136,7 @@ module ActionController
136
136
  MSG
137
137
  end
138
138
 
139
- def default_extension
140
- @default_extension
141
- end
139
+ attr_reader :default_extension
142
140
 
143
141
  def cache_file(path, extension)
144
142
  if path.empty? || path =~ %r{\A/+\z}
@@ -275,7 +273,13 @@ module ActionController
275
273
  request.path
276
274
  end
277
275
 
278
- if (type = Mime::LOOKUP[self.content_type]) && (type_symbol = type.symbol).present?
276
+ type = if self.respond_to?(:media_type)
277
+ Mime::LOOKUP[self.media_type]
278
+ else
279
+ Mime::LOOKUP[self.content_type]
280
+ end
281
+
282
+ if type && (type_symbol = type.symbol).present?
279
283
  extension = ".#{type_symbol}"
280
284
  end
281
285
 
@@ -24,7 +24,6 @@ module PageCachingTestHelpers
24
24
  end
25
25
 
26
26
  private
27
-
28
27
  def assert_page_cached(action, options = {})
29
28
  expected = options[:content] || action.to_s
30
29
  path = cache_file(action, options)
@@ -330,19 +329,17 @@ class PageCachingTest < ActionController::TestCase
330
329
  end
331
330
 
332
331
  def test_page_caching_directory_set_as_pathname
333
- begin
334
- ActionController::Base.page_cache_directory = Pathname.new(FILE_STORE_PATH)
335
-
336
- draw do
337
- get "/page_caching_test/ok", to: "page_caching_test#ok"
338
- end
332
+ ActionController::Base.page_cache_directory = Pathname.new(FILE_STORE_PATH)
339
333
 
340
- get :ok
341
- assert_response :ok
342
- assert_page_cached :ok
343
- ensure
344
- ActionController::Base.page_cache_directory = FILE_STORE_PATH
334
+ draw do
335
+ get "/page_caching_test/ok", to: "page_caching_test#ok"
345
336
  end
337
+
338
+ get :ok
339
+ assert_response :ok
340
+ assert_page_cached :ok
341
+ ensure
342
+ ActionController::Base.page_cache_directory = FILE_STORE_PATH
346
343
  end
347
344
 
348
345
  def test_page_caching_directory_set_on_controller_instance
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.1.1
4
+ version: 1.2.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: 2018-09-25 00:00:00.000000000 Z
11
+ date: 2019-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '6'
19
+ version: 5.0.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 4.0.0
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '6'
26
+ version: 5.0.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: mocha
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -60,10 +54,10 @@ files:
60
54
  - README.md
61
55
  - Rakefile
62
56
  - actionpack-page_caching.gemspec
63
- - gemfiles/Gemfile-4-0-stable
64
- - gemfiles/Gemfile-4-1-stable
65
- - gemfiles/Gemfile-4-2-stable
66
57
  - gemfiles/Gemfile-5-0-stable
58
+ - gemfiles/Gemfile-5-1-stable
59
+ - gemfiles/Gemfile-5-2-stable
60
+ - gemfiles/Gemfile-6-0-stable
67
61
  - gemfiles/Gemfile-edge
68
62
  - lib/action_controller/caching/pages.rb
69
63
  - lib/action_controller/page_caching.rb
@@ -84,15 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
78
  requirements:
85
79
  - - ">="
86
80
  - !ruby/object:Gem::Version
87
- version: 1.9.3
81
+ version: 2.4.6
88
82
  required_rubygems_version: !ruby/object:Gem::Requirement
89
83
  requirements:
90
84
  - - ">="
91
85
  - !ruby/object:Gem::Version
92
86
  version: '0'
93
87
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.6.11
88
+ rubygems_version: 3.0.3
96
89
  signing_key:
97
90
  specification_version: 4
98
91
  summary: Static page caching for Action Pack (removed from core in Rails 4.0)
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec path: ".."
4
-
5
- gem "rails", github: "rails/rails", branch: "4-0-stable"
6
- gem "mime-types", "< 3"
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec path: ".."
4
-
5
- gem "rails", github: "rails/rails", branch: "4-1-stable"
6
- gem "mime-types", "< 3"
@@ -1,10 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec path: ".."
4
-
5
- gem "rails", github: "rails/rails", branch: "4-2-stable"
6
- gem "mime-types", "< 3"
7
-
8
- if RUBY_VERSION < "2.1"
9
- gem "nokogiri", "< 1.7"
10
- end