erector-rails4 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e211a8ac04b10af2252d4713e0ce8ec22424a8ba
4
- data.tar.gz: c301fdd53d28c30c6d68da8d9c9ca8b5eef52f5e
3
+ metadata.gz: 76617a89c514165596b405b26b4d478954e8d2f4
4
+ data.tar.gz: 8918a4e0c6781101c4d5535af2dc8c9948c509c2
5
5
  SHA512:
6
- metadata.gz: 0a559f5f718628a692414c3a6c5f36144975db97828841ca0f9bb3ec6756e72ea739df674c91dc21c30f30cf7566785a8f7390a0d4ec698dc2e72cf5f1a1a270
7
- data.tar.gz: d03c8b61cf5365588e4fc18fdb4afe72c70ffc853580690beb10a8c2366a3673d98d9f1b3b9d3f08bd008a78847e44ac157883e0c978117297ba6ad3528b9ecf
6
+ metadata.gz: 175007a5293001ebfba00e9fd7c80a2a89826a89b55227cb7328eac9c923e23827e1227ba81bf54481aabfdb421ee0963140c1ccb665b78f211016b43335546b
7
+ data.tar.gz: ec15d388ca8691a1d67423207c1e4cffb59e2711b187784f5fe8760430039b03314471c2c8efeacfb65db6b14867b7d6995b5e8977a914eaf53e14aa3a0f4339
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- erector-rails4 (0.0.4)
4
+ erector-rails4 (0.0.5)
5
5
  rails (>= 4.0)
6
6
  treetop (>= 1.2.3)
7
7
 
@@ -37,13 +37,19 @@ module Erector
37
37
  end
38
38
 
39
39
  def should_cache?
40
- if block.nil? && self.class.cachable?
40
+ if block.nil? && self.class.cachable? && caching_configured?
41
41
  true
42
42
  else
43
43
  false
44
44
  end
45
45
  end
46
46
 
47
+ def caching_configured?
48
+ return true if !defined?(Rails)
49
+ ::Rails.configuration.action_controller.perform_caching &&
50
+ ::Rails.configuration.action_controller.cache_store
51
+ end
52
+
47
53
  protected
48
54
  def _emit(options = {})
49
55
  if should_cache?
@@ -1,3 +1,3 @@
1
1
  module Erector
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -12,7 +12,7 @@ Dummy::Application.configure do
12
12
  # Show full error reports and disable caching
13
13
  config.consider_all_requests_local = true
14
14
  config.action_view.debug_rjs = true
15
- config.action_controller.perform_caching = false
15
+ config.action_controller.perform_caching = true
16
16
 
17
17
  # Don't care if the mailer can't send
18
18
  config.action_mailer.raise_delivery_errors = false
@@ -18,7 +18,7 @@ Dummy::Application.configure do
18
18
 
19
19
  # Show full error reports and disable caching.
20
20
  config.consider_all_requests_local = true
21
- config.action_controller.perform_caching = false
21
+ config.action_controller.perform_caching = true
22
22
 
23
23
  # Raise exceptions instead of rendering exception templates.
24
24
  config.action_dispatch.show_exceptions = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erector-rails4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Chaffee