Commit Graph
22 Commits
Author SHA1 Message Date
chenxianyu aa79c33dda fix: Strainer.add_filter method 2017-02-13 15:50:19 +08:00
Dylan Thacker-SmithandGitHub b146b49f46 fix: Clear the strainer cache when a global filter is added (#826) 2016-11-24 10:32:11 -05:00
Gaurav Chande 8e6b9d503d Make Strainer also raise when registered method is overriden as protected 2016-02-24 20:23:49 +00:00
Gaurav Chande 8be38d1795 Strainer#add_filter should raise when registered method is overriden as private 2016-02-24 20:03:17 +00:00
Ivan Kuznetsov dadd9b4dd2 Add strict_variables/strict_filters render options to check for undefined variables and filters 2016-02-03 10:49:33 +07:00
Nick Pearson c582023321 Keep original stack trace in Liquid::ArgumentError 2015-10-29 08:15:37 -05:00
Florian Weingarten 3372ca8136 Rubocop 2015-05-14 14:37:18 +00:00
Dylan Thacker-Smith 950f062041 Allow filters to redefine Object methods to make them invokable. 2015-02-03 13:51:33 -05:00
Bogdan Gusiev f23e69d565 Raise liquid argument error instead of ruby argument
Wrong number of arguments for filter invocation now raises
Liuqid::ArgumentError but not ::ArgumentError
2014-02-21 22:12:11 +02:00
Florian Weingarten f1a5f6899b Add raggi's change to History, remove Ruby 1.8 code from test 2013-11-25 10:48:03 -05:00
James Tucker 13c826933c Update against failed cherry-pick 2013-09-07 01:42:41 +00:00
James Tucker 9b2d5b7dd3 Add a class cache to avoid runtime extend calls
* Strainer has a class cache that creates Strainer subclasses for each filter
   set that is used on .create calls.
 * Context now creates a list of filters and passes this to Strainer.create to
   utilize the class cache in almost all use cases.
 * If add_filter was called after a render, then the method cache may still be
   invalidated.

Conflicts:

	lib/liquid/strainer.rb
2013-08-31 18:56:35 +00:00
Tasos Stathopoulos 8c1bbfec57 Use array instead of Hash to keep the registered filters
1.8.7 compatibility fix

In Ruby 1.8.7, Hash does not preserve insertion ordering as Array does.
This could cause a problem when registering filters which depend on others and
the registration order is important.

So, the @@filters variable was changed to array where the order of the filters is
the same as the insertion order.
2013-05-17 14:12:57 +03:00
Dylan Smith 38b4543bf1 Use sets to check if methods are invokable without symbolizing. 2013-02-05 14:45:08 -05:00
Jason Roelofs 1300210f05 Convert Strainer to white-list method protection
After moving the method existence check from Context into Strainer,
updated Strainer to only accept invokation methods that were added via
filter Modules, and done in a way that respond_to? is never called,
preventing unconstrained Symbol table growth.
2013-01-16 11:14:01 -05:00
Jonathan Rudenberg c47eac1683 Add kind_of? and singleton_methods to Strainer so that Rubinius works 2011-06-30 16:17:31 -04:00
DBAandTobias Lütke 8e4573a7bf Strainer
- respond_to_missing? is now a required method
2010-08-23 01:29:59 +08:00
Jakub KuźmaandTobias Lütke ed1b542abf All tests pass on Ruby 1.9.1
Signed-off-by: Tobias Lütke <[email protected]>
2009-04-17 06:33:28 +08:00
Jakub KuźmaandTobias Lütke daadb1a2d6 Ruby 1.9.1 bugfixes
Signed-off-by: Tobias Lütke <[email protected]>
2009-04-17 06:33:20 +08:00
Joseph Anthony Pasquale Holsten c15a683063 Fixed Strainer#respond_to? to accept two parameters 2008-11-02 06:24:07 -06:00
Tobias Lütke 7f58cbf82d Merged last set of changes from original SVN location 2008-05-08 11:34:43 -04:00
Tobias Lütke 1d647361e1 Initial github import of liquid 2008-05-08 11:28:13 -04:00