Commit Graph
34 Commits
Author SHA1 Message Date
Dylan Thacker-Smith 03d586aafe Add convenience methods for getting a struct from a ruby object.
If we are trying to get the struct from something other than self, then we
should make sure to check the class of the object.  This util functions
make this easier.
2014-02-28 10:08:55 -05:00
Dylan Thacker-Smith dc8a34a52f Implement Block#parse_body in C. 2014-02-28 07:47:36 -05:00
Dylan Thacker-Smith 99cebf74bc Rename Block#parse to parse_body since that is how it is being used. 2014-02-27 23:16:11 -05:00
Dylan Thacker-Smith 7eb64886dc Move the parse method out of Tag, only blocks need the body parsed.
The parse method should be renamed to something like parse_body,
since that is how it is used, and no non-block tags were using the
parse method.
2014-02-27 22:31:09 -05:00
Dylan Thacker-Smith f89046e81f Use super rather than render_all in single block render classes. 2014-02-27 21:38:49 -05:00
Dylan Thacker-Smith 9ee4573ef4 Avoid keeping track of two lists of nodes during parsing. 2014-02-27 20:51:05 -05:00
Dylan Thacker-Smith a48b4f47f6 Return nil in Document#block_delimiter rather than an empty array.
The block delimiter is normally a string, so nil makes more sense when
there is no delimiter. We also don't want to allocate an array for no
reason.
2014-02-27 20:06:57 -05:00
Dylan Thacker-Smith 72d402837e Remove unused Block#end_tag method.
Although the method is called, it is defined with an empty body and not
overridden to do anything else.
2014-02-27 18:53:18 -05:00
Dylan Thacker-Smith 06bef40527 Fix a missing return warning. 2014-02-27 18:47:55 -05:00
Dylan Thacker-Smith a48b245e6e Turn on C compiler warnings. 2014-02-27 18:45:57 -05:00
Dylan Thacker-Smith d4aabda625 Avoid freeing of uninitialized memory.
Thanks to Isha for pointing this out.
2014-02-27 18:32:19 -05:00
Dylan Thacker-Smith dab6bdfdee Make sure the ext directory is included in the distributed gem. 2014-02-27 15:50:43 -05:00
Dylan Thacker-Smith 8c075fca1f Remove a couple FIXME comments which are only partially a lie.
I added those comments before creating an invalid token type to return the
error. However, we still aren't making use of the token type.
2014-02-27 15:21:57 -05:00
Dylan Thacker-Smith ea8406e36e Create a Liquid::Tokenizer class in the C extension. 2014-02-27 15:20:22 -05:00
Dylan Thacker-Smith 8bb3bca64a Require the liquid extension when liquid is required. 2014-02-27 14:22:18 -05:00
Dylan Thacker-Smith 5de1082201 Add profile:stackprof rake task. 2014-02-27 11:20:49 -05:00
Dylan Thacker-Smith 7ba02d2811 Use start and end of string rather than line matching in regexes. 2014-02-27 10:07:04 -05:00
Dylan Thacker-Smith 2066676bf4 Add a C extension that doesn't yet do anything. 2014-02-27 09:58:33 -05:00
Dylan Thacker-Smith 3efa8e8762 Merge pull request #310 from Shopify/faster-increment-used-resources
Speed up Context#increment_used_resources
2014-02-25 00:18:27 -05:00
Dylan Thacker-Smith 3c06d837b5 Speed up Context#increment_used_resources 2014-02-24 23:56:39 -05:00
Dylan Thacker-Smith 4e14a651a7 Merge pull request #274 from Shopify/restrict-send-on-conditions
security: Prevent arbitrary method invocation on conditions in if tag.
2013-10-28 10:01:47 -07:00
Dylan Thacker-Smith cc982e92d0 security: Prevent arbitrary method invocation on conditions in if tag. 2013-10-28 12:20:27 -04:00
Dylan Thacker-Smith 437e9201de Merge pull request #174 from yardstick/drop-context
Allow a Liquid::Drop to be passed into Template#render
2013-06-10 07:46:06 -07: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
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
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
Dylan Smith f7d1e1d0c1 Release 2.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
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
Dylan Smith 38b4543bf1 Use sets to check if methods are invokable without symbolizing. 2013-02-05 14:45:08 -05: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
Dylan Smith f5a20ff8e8 Fix a regression in tablerow limit parameter.
I had accidentally read slice_collection_using_each as using to as an
inclusive limit rather than exclusive, and no tests covered the offset or
limit parameters.
2012-06-21 14:56:05 -04:00
Dylan Smith d0184555d9 Allow tablerow to work with any Enumerable. Closes #132 2012-06-20 11:07:11 -04:00