jbuilder 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47936732d4887c511042bf1504e9b8062c1ee555
4
- data.tar.gz: 13b65badc0d39e8a282b8294462fbe55e194d5a2
3
+ metadata.gz: 3141e1a87d6a858eed1e1744e0d3f77dfd1f2285
4
+ data.tar.gz: 20846381277c1288b86db8fb0c7bfd53421ce484
5
5
  SHA512:
6
- metadata.gz: 331760ba6d93c905f70fbc6a25378e1cf6b055dce8703a204540bdc9745dd56402c9cbe0fc1d6b8a5ed86fb2c5d957e737460667621a1f0ff718c9367aa1c9aa
7
- data.tar.gz: dbc9629031037315974d03f4def0a541522c2a85774a42ba56edc41df26acee927304756c267f3fce0130f9529b2a25533ca9bd907906a2a21cb7398dde0b677
6
+ metadata.gz: 90cef844168896f3deef2cd9b83dfea34b3080687e33b412acc884e76f66f1e4b5994f71302712097f47028eba0482c57ac43dcf07e16b18956ddaa93a777f1d
7
+ data.tar.gz: d4c479bdf1b91218a821cf10ae3823c1f3bf8fafd7df54605d724510ea69a4da276112cbb71d54e0ee8b5dfab2538f64835189d0f023c359ed5e62f9c9465865
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '2.0.0'
3
+ s.version = '2.0.1'
4
4
  s.author = 'David Heinemeier Hansson'
5
5
  s.email = 'david@37signals.com'
6
6
  s.summary = 'Create JSON structures via a Builder-style DSL'
@@ -328,8 +328,5 @@ class Jbuilder < JbuilderProxy
328
328
  end
329
329
 
330
330
  require 'jbuilder/jbuilder_template' if defined?(ActionView::Template)
331
-
332
- if defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR == 4
333
- require 'jbuilder/railtie'
334
- require 'jbuilder/dependency_tracker'
335
- end
331
+ require 'jbuilder/dependency_tracker'
332
+ require 'jbuilder/railtie' if defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR == 4
@@ -1,9 +1,21 @@
1
1
  require 'jbuilder'
2
- require 'action_view'
3
- require 'action_view/dependency_tracker'
4
2
 
5
- class Jbuilder
6
- class DependencyTracker < ::ActionView::DependencyTracker::ERBTracker
3
+ dependency_tracker = false
4
+
5
+ begin
6
+ require 'action_view'
7
+ require 'action_view/dependency_tracker'
8
+ dependency_tracker = ::ActionView::DependencyTracker
9
+ rescue LoadError
10
+ begin
11
+ require 'cache_digests'
12
+ dependency_tracker = ::CacheDigests::DependencyTracker
13
+ rescue LoadError
14
+ end
15
+ end
16
+
17
+ if dependency_tracker
18
+ dependency_tracking_module = Module.new do
7
19
  # Matches:
8
20
  # json.partial! "messages/message"
9
21
  # json.partial!('messages/message')
@@ -40,11 +52,8 @@ class Jbuilder
40
52
  source.scan(INDIRECT_RENDERS).map(&:second)
41
53
  end
42
54
  end
43
- end
44
-
45
55
 
46
- ActiveSupport.on_load :action_view do
47
- ActiveSupport.on_load :after_initialize do
48
- ActionView::DependencyTracker.register_tracker :jbuilder, Jbuilder::DependencyTracker
49
- end
56
+ ::Jbuilder::DependencyTracker = Class.new(dependency_tracker::ERBTracker)
57
+ ::Jbuilder::DependencyTracker.send :include, dependency_tracking_module
58
+ dependency_tracker.register_tracker :jbuilder, ::Jbuilder::DependencyTracker
50
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
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: 2013-12-20 00:00:00.000000000 Z
11
+ date: 2013-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport