This repository has been archived by the owner on Nov 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configuration for allowing rerendering
+ Adds configure block + Changes default to not cleanup re-rendering cache keys
- Loading branch information
1 parent
6a10113
commit 9a56a37
Showing
9 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
get_schwifty (0.1.0) | ||
get_schwifty (0.1.1) | ||
rails (> 5) | ||
|
||
GEM | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# GetSchwifty configuration initializer | ||
# Use this file to configure GetSchwifty for your needs | ||
GetSchwifty.configure do |config| | ||
# Configure re-rendering | ||
# | ||
# By default, job parameters are stored in the Rails cache and not removed after render | ||
# If your're not expring keys with a Least Recently Used policy, you cache could fill up | ||
# with values which will never be accessed again. | ||
# | ||
# Allow rerendering | ||
# This allows caching of `get_schwifty` helper calls in views | ||
# config.allow_rerender = true # Default | ||
|
||
# Disable rerendering | ||
# This disables rerendering, and the cachability of `get_schwifty` helper calls. Subscriptions | ||
# will be rejected after the first render of a cached `get_schwifty` call | ||
# config.allow_rerender = false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module GetSchwifty | ||
VERSION = '0.1.0' | ||
VERSION = "0.1.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# GetSchwifty configuration initializer | ||
# Use this file to configure GetSchwifty for your needs | ||
GetSchwifty.configure do |config| | ||
# Configure re-rendering | ||
# | ||
# By default, job parameters are stored in the Rails cache and not removed after render | ||
# If your're not expring keys with a Least Recently Used policy, you cache could fill up | ||
# with values which will never be accessed again. | ||
# | ||
# Allow rerendering | ||
# This allows caching of `get_schwifty` helper calls in views | ||
# config.allow_rerender = true # Default | ||
|
||
# Disable rerendering | ||
# This disables rerendering, and the cachability of `get_schwifty` helper calls. Subscriptions | ||
# will be rejected after the first render of a cached `get_schwifty` call | ||
# config.allow_rerender = false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
require 'test_helper' | ||
|
||
class GetSchwifty::Test < ActiveSupport::TestCase | ||
test "truth" do | ||
assert_kind_of Module, GetSchwifty | ||
test "mattr configuration" do | ||
GetSchwifty.allow_rerender = false | ||
refute GetSchwifty.allow_rerender | ||
end | ||
|
||
test "configuraiton block" do | ||
GetSchwifty.configure { |config| config.allow_rerender = false } | ||
refute GetSchwifty.allow_rerender | ||
end | ||
end |