breezy_template 0.3.0 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 389577cd7a952f1dc9c01fa549bd9fb4328dc7da
|
4
|
+
data.tar.gz: fc00b911792bcbba351e458a1cdb763cebc1c80d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f26770f783bed26af579db8b0bcdb2b87907a968d826e0bfd10705781f42b884a26d2fcf19eabc78bad4b2da21eb8661d766a2bbfd6ba81cdd9bcd0264d115e8
|
7
|
+
data.tar.gz: 88d00aa5d417488e872ea0b3a91d50c4dd7f1eb750616ae44333ea47a3fc2f17d53da5e7b0ecf4dfaf87ad5c866ead0be12dd7d93a101fc3cffa4c56aacdf362
|
@@ -117,7 +117,7 @@ class BreezyTemplate
|
|
117
117
|
def _cache_key(key, options={})
|
118
118
|
key = _fragment_name_with_digest(key, options)
|
119
119
|
key = url_for(key).split('://', 2).last if ::Hash === key
|
120
|
-
key = ::ActiveSupport::Cache.expand_cache_key(key, :
|
120
|
+
key = ::ActiveSupport::Cache.expand_cache_key(key, :breezy)
|
121
121
|
|
122
122
|
::Digest::MD5.hexdigest(key.to_s).tap do |digest|
|
123
123
|
_logger.try :debug, "Cache key :#{key} was digested to #{digest}"
|
@@ -1,6 +1,24 @@
|
|
1
1
|
require 'breezy_template/breezy_template'
|
2
2
|
|
3
3
|
class BreezyTemplate
|
4
|
+
class Undefined
|
5
|
+
def initialize
|
6
|
+
@value = "undefined"
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_json(*)
|
10
|
+
@value
|
11
|
+
end
|
12
|
+
|
13
|
+
def as_json(*)
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def encode_json(*)
|
18
|
+
@value
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
4
22
|
module DefermentExtension
|
5
23
|
ACTIVE_MODES = [:auto, :manual].freeze
|
6
24
|
|
@@ -10,7 +28,7 @@ class BreezyTemplate
|
|
10
28
|
if _deferment_auto?(options)
|
11
29
|
@js.push(_breezy_visit_current(@path))
|
12
30
|
end
|
13
|
-
return _set_value key,
|
31
|
+
return _set_value key, Undefined.new
|
14
32
|
else
|
15
33
|
super
|
16
34
|
end
|
data/test/extensions_test.rb
CHANGED
@@ -1003,7 +1003,7 @@ class BreezyTemplateTest < ActionView::TestCase
|
|
1003
1003
|
var cache={};
|
1004
1004
|
var defers=[];
|
1005
1005
|
cache["#{cache_keys[0]}"]={"greeting":"hello world"};
|
1006
|
-
return ({"data":cache["
|
1006
|
+
return ({"data":cache["#{cache_keys[0]}"],"action":"graft","path":"hit.hit2","joints":joints,"defers":defers});
|
1007
1007
|
})()
|
1008
1008
|
|
1009
1009
|
|
@@ -1156,7 +1156,7 @@ class BreezyTemplateTest < ActionView::TestCase
|
|
1156
1156
|
var defers=[];
|
1157
1157
|
defers.push({url:'/some_url?_breezy_filter=hit.hit2'});
|
1158
1158
|
return (
|
1159
|
-
{"data":{"hit":{"hit2":
|
1159
|
+
{"data":{"hit":{"hit2":undefined}},"joints":joints,"defers":defers}
|
1160
1160
|
);
|
1161
1161
|
})()
|
1162
1162
|
JS
|
@@ -1185,7 +1185,7 @@ class BreezyTemplateTest < ActionView::TestCase
|
|
1185
1185
|
var cache={};
|
1186
1186
|
var defers=[];
|
1187
1187
|
return (
|
1188
|
-
{"data":{"hit":{"hit2":
|
1188
|
+
{"data":{"hit":{"hit2":undefined}},"joints":joints,"defers":defers}
|
1189
1189
|
);
|
1190
1190
|
})()
|
1191
1191
|
JS
|
@@ -1219,7 +1219,7 @@ class BreezyTemplateTest < ActionView::TestCase
|
|
1219
1219
|
defers.push({url:'/some_url?_breezy_filter=hit.hit2.id%3D1.greeting'});
|
1220
1220
|
defers.push({url:'/some_url?_breezy_filter=hit.hit2.id%3D2.greeting'});
|
1221
1221
|
return (
|
1222
|
-
{"data":{"hit":{"hit2":[{"greeting":
|
1222
|
+
{"data":{"hit":{"hit2":[{"greeting":undefined},{"greeting":undefined}]}},"joints":joints,"defers":defers}
|
1223
1223
|
);
|
1224
1224
|
})()
|
1225
1225
|
JS
|
@@ -1283,7 +1283,7 @@ class BreezyTemplateTest < ActionView::TestCase
|
|
1283
1283
|
var cache={};
|
1284
1284
|
var defers=[];
|
1285
1285
|
defers.push({url:'?_breezy_filter=hello.content'});
|
1286
|
-
return ({"data":{"content":
|
1286
|
+
return ({"data":{"content":undefined},"action":"graft","path":"hello","joints":joints,"defers":defers});
|
1287
1287
|
})()
|
1288
1288
|
JS
|
1289
1289
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breezy_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johny Ho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|