Commit Graph
278 Commits
Author SHA1 Message Date
Arthur Neves ab760649ee use BigDecimal on filters to have better precision 2013-06-05 16:09:05 -04:00
Florian Weingarten f4fb2f159c Merge pull request #157 from stomar/avoid_warnings
Avoid warnings in Ruby 1.9.3
2013-06-05 09:10:41 -07:00
Florian Weingarten a5cd494717 Merge pull request #176 from unreal/master
Add reverse filter
2013-06-05 09:04:53 -07:00
Florian Weingarten f8915f3cd2 Merge pull request #199 from phoet/add_documentation_for_include
add documentation to include, fixes #163
2013-06-05 09:00:11 -07:00
Peter Schröder e92540a9bf add documentation to include, fixes #163 2013-06-05 11:53:01 -04:00
Dylan Thacker-Smith 482115d784 Merge pull request #173 from jsw0528/master
fix `can't convert Fixnum into String` for `replace`
2013-06-04 13:09:42 -07:00
Florian Weingarten 94ff457744 Merge pull request #198 from Shopify/limit_resource_usage
Resource usage limits
2013-05-31 08:24:29 -07:00
Florian Weingarten 1e8c081b42 Create new resource_limits hash on Template initialization 2013-05-31 09:41:59 -04:00
Florian Weingarten 2b17e24b16 Mutate resource_limits hash to flag that the limit was reached (for outside observation) 2013-05-31 09:34:23 -04:00
Florian Weingarten 9075b428b1 Resource limits: Don't raise Error but render error message (but abort after first error) 2013-05-31 09:25:25 -04:00
Florian Weingarten 8760b5e8c4 Add optional resource usage limitations to number of rendering calls, length of rendering output and/or number of variable/capture assignments 2013-05-30 17:04:26 -04:00
Tom Burns 50b2ebee56 Merge pull request #189 from Shopify/cache_partials
Cache tokenized partial templates
2013-05-29 07:51:12 -07:00
Dylan Thacker-Smith 23203c0122 Fix some old templates that abused colon as an argument separator.
This is a fallback for keyword argument parsing since this feature broke
old templates that accidentally used a colon as a filter argument
separator.
2013-05-21 17:47:46 -04:00
Tom Burns 27fe76c0dd Merge pull request #192 from Shopify/revert_utf8
Revert "Merge pull request #185 from ISSIntel/liquid-utf8"
2013-05-21 14:46:17 -07:00
Tom Burns 8913a5615a Revert "Merge pull request #185 from ISSIntel/liquid-utf8"
This reverts commit c5dfcd29b0, reversing
changes made to f7d1e1d0c1.
2013-05-20 19:53:13 -04:00
Dylan Thacker-Smith 690b3ff27f Merge pull request #135 from astathopoulos/preserve_filters_ordering
Use array instead of Hash to keep the registered filters
2013-05-17 05:25:07 -07: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
Tom Burns b8fbd2b4fa typo 2013-05-16 20:25:31 -04:00
Tom Burns ba5a9f2e47 remove _ on private methods 2013-05-13 13:45:43 -04:00
Tom Burns 1e309ba74b cache included partial templates 2013-05-13 02:34:19 -04:00
Tom Burns 485340713a Add tests for caching partial includes 2013-05-13 02:34:19 -04:00
Tom Burns 2af4ea1295 Support benchmarking templates with 'include' tag 2013-05-12 22:17:08 -04:00
Tom Burns c5dfcd29b0 Merge pull request #185 from ISSIntel/liquid-utf8
Liquid UTF-8 support
2013-04-23 10:29:49 -07:00
Ozéias Sant'ana f9c289372d Merge branch 'master' into liquid-utf8
Conflicts:
	lib/liquid/variable.rb
2013-04-23 13:10:16 -03:00
Jay Strybis a556ae6c26 Add reverse filter 2013-03-07 16:29:39 -06:00
Dylan Smith f7d1e1d0c1 Release 2.5.0 v2.5.0 2013-03-06 10:51:06 -05:00
Dylan Smith 28fd2222c8 Merge branch 'remove-symbolizing' 2013-03-05 16:33:56 -05:00
Marcus Stollsteimer 1cac09831d Completely remove unused variable 2013-03-05 22:19:38 +01:00
Dylan Smith 9913895b81 Merge branch 'master' into remove-symbolizing
Conflicts:
	lib/liquid/variable.rb
2013-03-05 15:25:11 -05:00
Dylan Smith d706db3bd7 Add support for filter keyword arguments. Closes #175 2013-03-05 15:17:14 -05:00
wǒ_is神仙 17dd85868d add tests for replace filter 2013-02-21 10:52:46 +08:00
wǒ_is神仙 6e967f7f3a fix can't convert Fixnum into String 2013-02-06 12:55:35 +08: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
Jason Roelofs a48e162237 Change Drop method lookup to not hit respond_to?
Class.public_method_defined? ends up diving into Ruby's core looking for
a method with the given method_or_key. This process at some point turns
method_or_key into a Symbol. This change no longer takes that path and
thus doesn't grow the Symbol table.
2013-01-16 11:07:48 -05:00
Jason Roelofs 7bcb565668 Remove #to_sym calls from Drop and Variable
Symbols are not needed here and using plain strings is nicer on Ruby
2013-01-16 09:46:17 -05:00
Jason Roelofs c3e6cde67f Add security tests to show that the symbol table doesn't grow 2013-01-16 09:46:17 -05:00
Adam Tanner 0b36540b78 Liquid has UTF8 support. 2012-12-26 18:14:36 -08:00
Dylan Smith 50bd34fd78 Merge pull request #161 from Shopify/fix-filter-parser-regex
Fix filter parser regex for filter args without separating spaces.
2012-12-18 10:13:21 -08:00
Dylan Smith ee41b3f4a3 Fix filter parser regex for filter args without separating spaces.
The regex was using \S+ to match the comma between the filters
arguments, but would continue to match idependent quote characters and
filter separators. This can result in multiple filters being interpreted as
a single one with many arguments.
2012-12-18 01:23:31 -05:00
Marcus Stollsteimer b48ad7da3a Remove trailing whitespace 2012-11-18 10:29:22 +01:00
Marcus Stollsteimer afc3944a4a Fix assignment with no effect outside of iterator 2012-11-18 10:21:03 +01:00
Marcus Stollsteimer c79abf1f87 Avoid warnings for assigned but unused variable 2012-11-18 10:20:07 +01:00
Marcus Stollsteimer 90b40ffb4b Avoid warnings for shadowed outer local variable 2012-11-18 10:19:05 +01:00
Marcus Stollsteimer fea9c54768 Avoid warning for grouped expression 2012-11-18 10:08:00 +01:00
Tobias Lütke 05d9976e16 fix benchmark 2012-10-29 16:47:57 -04:00
Tom Burns 6c2fde5eea Instantiate blank string once instead of at every comparison 2012-10-25 11:54:19 -04:00
Tobias Lütke ce76dbf8d9 fixed the performance suite 2012-10-20 10:53:53 -04:00
Steven Soroka 661ff2ccdf Merge pull request #140 from binarycleric/feature/break_for_loop
Added break and continue statements
2012-08-21 13:22:24 -07:00
Jon Daniel 9c183bea83 added interrupt class for continue/break statements
When a continue or break statement is executed it pushes an interrupt to a
stack in context. If any non-handled interrupts are present blocks will cease
to execute. The for loop can handle the most recent interrupt in the stack.
2012-08-21 13:14:27 -04:00