curly-templates 0.4.0 → 0.5.0

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.
data/README.md CHANGED
@@ -245,6 +245,10 @@ end
245
245
  Now, if the version of `Posts::CommentPresenter` is bumped, the cache keys for both
246
246
  presenters would change. You can register any number of view paths with `depends_on`.
247
247
 
248
+ If you use [Cache Digests](https://github.com/rails/cache_digests), Curly will
249
+ automatically provide a list of dependencies. This will allow you to deploy changes
250
+ to your templates and have the relevant caches automatically expire.
251
+
248
252
 
249
253
  Thanks
250
254
  ------
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'curly-templates'
7
- s.version = '0.4.0'
8
- s.date = '2013-04-18'
7
+ s.version = '0.5.0'
8
+ s.date = '2013-04-19'
9
9
 
10
10
  s.summary = "Free your views!"
11
11
  s.description = "A view layer for your Rails apps that separates structure and logic."
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  curly-templates.gemspec
35
35
  lib/curly-templates.rb
36
36
  lib/curly.rb
37
+ lib/curly/dependency_tracker.rb
37
38
  lib/curly/presenter.rb
38
39
  lib/curly/railtie.rb
39
40
  lib/curly/template_handler.rb
@@ -26,7 +26,7 @@
26
26
  # See Curly::Presenter for more information on presenters.
27
27
  #
28
28
  module Curly
29
- VERSION = "0.4.0"
29
+ VERSION = "0.5.0"
30
30
 
31
31
  REFERENCE_REGEX = %r(\{\{([\w\.]+)\}\})
32
32
 
@@ -0,0 +1,8 @@
1
+ module Curly
2
+ class DependencyTracker
3
+ def self.call(path, template)
4
+ presenter = Curly::Presenter.presenter_for_path(path)
5
+ presenter.dependencies
6
+ end
7
+ end
8
+ end
@@ -4,6 +4,11 @@ module Curly
4
4
 
5
5
  initializer 'curly.initialize_template_handler' do
6
6
  ActionView::Template.register_template_handler :curly, Curly::TemplateHandler
7
+
8
+ if defined?(CacheDigests::DependencyTracker)
9
+ require 'curly/dependency_tracker'
10
+ CacheDigests::DependencyTracker.register_tracker :curly, Curly::DependencyTracker
11
+ end
7
12
  end
8
13
  end
9
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curly-templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -115,6 +115,7 @@ files:
115
115
  - curly-templates.gemspec
116
116
  - lib/curly-templates.rb
117
117
  - lib/curly.rb
118
+ - lib/curly/dependency_tracker.rb
118
119
  - lib/curly/presenter.rb
119
120
  - lib/curly/railtie.rb
120
121
  - lib/curly/template_handler.rb
@@ -142,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
143
  version: '0'
143
144
  segments:
144
145
  - 0
145
- hash: 2429714789931258072
146
+ hash: 4267343467533588102
146
147
  required_rubygems_version: !ruby/object:Gem::Requirement
147
148
  none: false
148
149
  requirements: