Skip to content

Commit

Permalink
Fixed deprecation of using Proc.new to capture block; replaced with…
Browse files Browse the repository at this point in the history
… `&block`
  • Loading branch information
malomalo committed Jun 24, 2020
1 parent d6c4eca commit 5920095
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

1.9.0
-----
* Fixed deprecation of using `Proc.new` to capture block; replaced with `&block`

1.8.0
-----
* Make the StreamingRenderer Rails 6 compatible [PR #15](https://github.com/malomalo/turbostreamer/issues/15)
* Update gemspec to require Ruby 2.5+ [PR #14](https://github.com/malomalo/turbostreamer/issues/14)

1.7.0
-----
* Add the ability to set default options for encoders
* Allow setting the `buffer_size` on the OJ encode
* Reduce find_template calls [PR #11](https://github.com/malomalo/turbostreamer/pull/1)
* Don't require a layout to stream template in Rails

1.5.0
-----
* Add Rails 6.0 support
* Drop Rails 4.2 support

1.4.0
-----
* Replace deprecated fragment_cache_key for Rails 5.2 support

1.3.0
-----
* Bump version and update bundler

1.2.0
-----
* Add `TurboStreamer#merge!` to merge a hash or array into the current json stream.
Expand Down
4 changes: 2 additions & 2 deletions lib/turbostreamer/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def cache_collection!(collection, options = {}, &block)
# json.cache_if! !admin?, @person, expires_in: 10.minutes do
# json.extract! @person, :name, :age
# end
def cache_if!(condition, *args)
condition ? cache!(*args, &::Proc.new) : yield
def cache_if!(condition, *args, &block)
condition ? cache!(*args, &block) : yield
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/turbostreamer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class TurboStreamer
VERSION = '1.8.0'
VERSION = '1.9.0'
end
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
require File.expand_path('../../ext/actionview/streaming_template_renderer', __FILE__)

require "active_support/testing/autorun"
require 'mocha/setup'
require 'mocha/minitest'
require 'wankel'

if ENV["TSENCODER"]
Expand Down

0 comments on commit 5920095

Please sign in to comment.