From 5920095176a1bab90c6c1ee27e9342b03dd8647e Mon Sep 17 00:00:00 2001 From: Jon Bracy Date: Wed, 24 Jun 2020 16:51:46 -0500 Subject: [PATCH] Fixed deprecation of using `Proc.new` to capture block; replaced with `&block` --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ lib/turbostreamer/template.rb | 4 ++-- lib/turbostreamer/version.rb | 2 +- test/test_helper.rb | 2 +- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554eb43..c9779c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/turbostreamer/template.rb b/lib/turbostreamer/template.rb index 8addfaf..3126a39 100644 --- a/lib/turbostreamer/template.rb +++ b/lib/turbostreamer/template.rb @@ -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 diff --git a/lib/turbostreamer/version.rb b/lib/turbostreamer/version.rb index 00a98e5..3e6a8e3 100644 --- a/lib/turbostreamer/version.rb +++ b/lib/turbostreamer/version.rb @@ -1,3 +1,3 @@ class TurboStreamer - VERSION = '1.8.0' + VERSION = '1.9.0' end diff --git a/test/test_helper.rb b/test/test_helper.rb index db807b0..2b60706 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -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"]