turbostreamer 1.4.0 → 1.5.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
  SHA256:
3
- metadata.gz: 3ae9b21661109c4c0c2bd33752ed1351c90fbceed029340517cef5bfa9119f7b
4
- data.tar.gz: 66e40044dadce858725fb0421a1f7d0d79e8a962a61bf49936c0826857a54791
3
+ metadata.gz: 41cf2cabe5c4084620fea525158ec975f1d5d7785b2416aff205c6e97c6ff77f
4
+ data.tar.gz: 112322a9faa00a0e70e250222dbbdc3ec756879c886b4f448493802ddbc46d88
5
5
  SHA512:
6
- metadata.gz: d2c3227714fc63140972a3222e0d7922ea842c565c01cebdefe509d067bb8e990e47efe5aad8284fa1cac9e8d63aeb0b3dd40d4569e5eb6d7d29f22d1f95e241
7
- data.tar.gz: e63e9fb64ddfadf61c427ea2c2e47ec3d072b806b050a7f7a53d6f507898c61df40e8ed3b01230413b66afd486cc7dc31f857943f59778e2e56ed1f24605cc45
6
+ metadata.gz: b51fcf37f22a606e5a7dc072706e9e32468c3e92b5f1b9a2d6adf2102644a680ace31baef8486ac850675ff20182db4cd40e07c92cebaded6faaab2ac98a7bae
7
+ data.tar.gz: 81706cdc8ec9808cc573d6bb3d871977e0edc22744daa15b1d1c3811c7819b0181971e5553cc7ed416a2052b7bb92267ff1f093a79d9a5e07e69c0873a7486be
@@ -12,9 +12,13 @@ class TurboStreamer
12
12
  true
13
13
  end
14
14
 
15
- def self.call(template)
15
+ # TODO: setting source=nil is for rails 5.x compatability, once unsppored
16
+ # source can be a required param and
17
+ # `source = template.source if source.nil?` can be removed
18
+ def self.call(template, source=nil)
19
+ source = template.source if source.nil?
16
20
  # this juggling is required to keep line numbers right in the error
17
- %{__already_defined = defined?(json); json||=TurboStreamer::Template.new(self, output_buffer: output_buffer || ActionView::OutputBuffer.new); #{template.source}
21
+ %{__already_defined = defined?(json); json||=TurboStreamer::Template.new(self, output_buffer: output_buffer || ActionView::OutputBuffer.new); #{source}
18
22
  json.target! unless (__already_defined && __already_defined != "method")}
19
23
  end
20
24
 
@@ -179,6 +179,9 @@ class TurboStreamer::Template < TurboStreamer
179
179
 
180
180
  if @context.respond_to?(:combined_fragment_cache_key)
181
181
  key = @context.combined_fragment_cache_key(key)
182
+ elsif @context.respond_to?(:fragment_cache_key)
183
+ # TODO: remove after droping rails 5.1 support
184
+ key = @context.fragment_cache_key(key)
182
185
  elsif ::Hash === key
183
186
  key = url_for(key).split('://', 2).last
184
187
  end
@@ -199,16 +202,6 @@ class TurboStreamer::Template < TurboStreamer
199
202
  end
200
203
  end
201
204
 
202
- def _fragment_name_with_digest(key, options)
203
- if @context.respond_to?(:cache_fragment_name)
204
- # Current compatibility, fragment_name_with_digest is private again and cache_fragment_name
205
- # should be used instead.
206
- @context.cache_fragment_name(key, options)
207
- else
208
- key
209
- end
210
- end
211
-
212
205
  def _partial_options?(options)
213
206
  ::Hash === options && options.key?(:as) && options.key?(:partial)
214
207
  end
@@ -1,3 +1,3 @@
1
1
  class TurboStreamer
2
- VERSION = '1.4.0'
2
+ VERSION = '1.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbostreamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0
19
+ version: 5.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.0
26
+ version: 5.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement