Skip to content

Commit f1702f2

Browse files
author
Damian Galarza
committed
Remove caching support in HighVoltage
Page caching was deprecated in fac899f. In preparation to move towards Rails 5.0 support, we are removing built in caching support.
1 parent 27ee19e commit f1702f2

File tree

11 files changed

+0
-237
lines changed

11 files changed

+0
-237
lines changed

Appraisals

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ rails_versions = ['~> 4.0.0', '~> 4.1.0', '~> 4.2.0']
33
rails_versions.each do |rails_version|
44
appraise "rails#{rails_version.slice(/\d+\.\d+/)}" do
55
gem 'rails', rails_version
6-
gem 'actionpack-action_caching'
7-
gem 'actionpack-page_caching'
86
end
97
end

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,6 @@ HighVoltage.configure do |config|
166166
end
167167
```
168168

169-
#### Caching
170-
171-
Caching has been deprecated and will be removed in the next release.
172-
173-
Page caching and action caching can be done via Rails. Visit the [Caching with
174-
Rails: An overview](http://guides.rubyonrails.org/caching_with_rails.html) guide
175-
for more details. You can utilize the methods described there by overriding the
176-
HighVoltage controller as described [below](#override).
177-
178169
## Override
179170

180171
Most common reasons to override?

app/controllers/concerns/high_voltage/static_page.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ module HighVoltage::StaticPage
1414

1515
rescue_from HighVoltage::InvalidPageIdError, with: :invalid_page
1616

17-
if respond_to?(:caches_action)
18-
caches_action :show, layout: HighVoltage.action_caching_layout,
19-
if: -> { HighVoltage.action_caching }
20-
end
21-
22-
if respond_to?(:caches_page)
23-
caches_page :show, if: -> { HighVoltage.page_caching }
24-
end
25-
2617
hide_action :current_page, :page_finder, :page_finder_factory
2718
end
2819

gemfiles/rails4.0.gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ source "http://rubygems.org"
44

55
gem "appraisal"
66
gem "rails", "~> 4.0.0"
7-
gem "actionpack-action_caching"
8-
gem "actionpack-page_caching"
97

108
gemspec :path => "../"

gemfiles/rails4.1.gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ source "http://rubygems.org"
44

55
gem "appraisal"
66
gem "rails", "~> 4.1.0"
7-
gem "actionpack-action_caching"
8-
gem "actionpack-page_caching"
97

108
gemspec :path => "../"

gemfiles/rails4.2.gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ source "http://rubygems.org"
44

55
gem "appraisal"
66
gem "rails", "~> 4.2.0"
7-
gem "actionpack-action_caching"
8-
gem "actionpack-page_caching"
97

108
gemspec :path => "../"

lib/high_voltage/configuration.rb

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
module HighVoltage
22
module Configuration
3-
CACHING_DEPRECATION_WARNING = <<-WARNING.strip_heredoc.squish
4-
Caching support has been deprecated and will be removed
5-
in the next release.
6-
WARNING
7-
83
attr_accessor(
94
:content_path,
105
:home_page,
@@ -14,8 +9,6 @@ module Configuration
149
:routes,
1510
)
1611

17-
attr_reader :action_caching, :action_caching_layout, :page_caching
18-
1912
def configure
2013
yield self
2114
end
@@ -24,27 +17,6 @@ def self.extended(base)
2417
base.set_default_configuration
2518
end
2619

27-
def action_caching=(value)
28-
unless value == false
29-
ActiveSupport::Deprecation.warn(CACHING_DEPRECATION_WARNING)
30-
end
31-
@action_caching = value
32-
end
33-
34-
def action_caching_layout=(value)
35-
unless value == false
36-
ActiveSupport::Deprecation.warn(CACHING_DEPRECATION_WARNING)
37-
end
38-
@action_caching_layout = value
39-
end
40-
41-
def page_caching=(value)
42-
unless value == false
43-
ActiveSupport::Deprecation.warn(CACHING_DEPRECATION_WARNING)
44-
end
45-
@page_caching = value
46-
end
47-
4820
def page_ids
4921
HighVoltage::PageCollector.new(HighVoltage.full_path).page_ids
5022
end
@@ -54,10 +26,6 @@ def full_path
5426
end
5527

5628
def set_default_configuration
57-
@action_caching = false
58-
@action_caching_layout = true
59-
@page_caching = false
60-
6129
self.content_path = 'pages/'
6230
self.home_page = nil
6331
self.layout = 'application'

spec/controllers/action_caching_controller_spec.rb

Lines changed: 0 additions & 38 deletions
This file was deleted.

spec/controllers/page_caching_controller_spec.rb

Lines changed: 0 additions & 37 deletions
This file was deleted.

spec/high_voltage/configuration_spec.rb

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
before(:each) do
88
HighVoltage.configure do |config|
99
ActiveSupport::Deprecation.silence do
10-
config.action_caching = config_value
11-
config.action_caching_layout = config_value
1210
config.content_path = config_value
1311
config.layout = config_value
14-
config.page_caching = config_value
1512
config.parent_engine = config_value
1613
config.route_drawer = config_value
1714
config.routes = config_value
@@ -25,109 +22,10 @@
2522
end
2623
end
2724

28-
it { expect(HighVoltage.action_caching).to eq config_value }
29-
it { expect(HighVoltage.action_caching_layout).to eq config_value }
3025
it { expect(HighVoltage.content_path).to eq config_value }
3126
it { expect(HighVoltage.layout).to eq config_value }
32-
it { expect(HighVoltage.page_caching).to eq config_value }
3327
it { expect(HighVoltage.parent_engine).to eq config_value }
3428
it { expect(HighVoltage.route_drawer).to eq config_value }
3529
it { expect(HighVoltage.routes).to eq config_value }
3630
end
37-
38-
describe "#action_caching" do
39-
context "action caching is enabled" do
40-
it 'displays a deprecation warning' do
41-
allow(ActiveSupport::Deprecation).to receive(:warn)
42-
43-
HighVoltage.configure do |config|
44-
config.action_caching = true
45-
end
46-
47-
expect(ActiveSupport::Deprecation).to have_received(:warn)
48-
.with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING)
49-
end
50-
end
51-
52-
context "action caching is disabled" do
53-
it 'does not display a deprecation warning' do
54-
allow(ActiveSupport::Deprecation).to receive(:warn)
55-
56-
HighVoltage.configure do |config|
57-
config.action_caching = false
58-
end
59-
60-
expect(ActiveSupport::Deprecation).not_to have_received(:warn)
61-
.with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING)
62-
end
63-
end
64-
end
65-
66-
describe "#action_caching_layout" do
67-
context "action caching layout is enabled" do
68-
it 'displays a deprecation warning' do
69-
allow(ActiveSupport::Deprecation).to receive(:warn)
70-
71-
HighVoltage.configure do |config|
72-
config.action_caching_layout = true
73-
end
74-
75-
expect(ActiveSupport::Deprecation).to have_received(:warn)
76-
.with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING)
77-
end
78-
end
79-
80-
context "action caching layout is disabled" do
81-
it "does not display a deprecation warning" do
82-
allow(ActiveSupport::Deprecation).to receive(:warn)
83-
84-
HighVoltage.configure do |config|
85-
config.action_caching_layout = false
86-
end
87-
88-
expect(ActiveSupport::Deprecation).not_to have_received(:warn)
89-
.with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING)
90-
end
91-
end
92-
end
93-
94-
describe "#page_caching" do
95-
context "page caching is enabled" do
96-
it "displays a deprecation warning" do
97-
allow(ActiveSupport::Deprecation).to receive(:warn)
98-
99-
HighVoltage.configure do |config|
100-
config.page_caching = true
101-
end
102-
103-
expect(ActiveSupport::Deprecation).to have_received(:warn)
104-
.with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING)
105-
end
106-
end
107-
108-
context "page caching is disbled" do
109-
it "does not display a deprecation warning" do
110-
allow(ActiveSupport::Deprecation).to receive(:warn)
111-
112-
HighVoltage.configure do |config|
113-
config.page_caching = false
114-
end
115-
116-
expect(ActiveSupport::Deprecation).not_to have_received(:warn)
117-
.with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING)
118-
end
119-
end
120-
end
121-
122-
describe '#set_default_configuration' do
123-
it 'defaults caching without a deprecation warning' do
124-
allow(ActiveSupport::Deprecation).to receive(:warn)
125-
126-
Class.new do
127-
extend HighVoltage::Configuration
128-
end
129-
130-
expect(ActiveSupport::Deprecation).not_to have_received(:warn)
131-
end
132-
end
13331
end

0 commit comments

Comments
 (0)