Commit Graph

97 Commits

Author SHA1 Message Date
Anatoliy Yastreb 9176924eab filters: raise error if no input given to date filters 2016-07-24 01:37:35 +03:00
XhmikosR dbc0349909 tests: Typo fixes. 2016-07-18 21:20:47 +03:00
David Zhang 20b3758edb Add to_integer filter
Add to_integer filter

Fix test_filter: parenthesize the method

Fix offense: seperate every 3 digits with _

rubocop:disable Metrics/ModuleLength

More descriptive exception

Fix fmt error

Remove if stmt for integer input

Remove rescue for to_i

Remove error message assert
2016-07-15 08:38:36 +08:00
Parker Moore a7d25ed963
Fix rubocop offenses on master. 2016-06-28 22:08:06 -07:00
jekyllbot fb1a459ddd Merge pull request #4917 from pathawks/pr/normalize_whitespace
Merge pull request 4917
2016-06-14 14:03:05 -07:00
Pat Hawks 5dfaa66d48 Failing test: markdownify a number 2016-05-28 15:18:37 -05:00
Pat Hawks 6ef2bcb29a Rubocop: test/test_filters.rb 2016-05-25 21:59:11 -05:00
Parker Moore f8c708ffec Fix test to simply ensure next is an object in jsonify 2016-05-24 19:08:50 -05:00
Parker Moore 17d8c96a63 Add ability to render drops as JSON
Previously you could do, e.g. {{ site | jsonify }}, but with the introduction of Liquid Drops, this didn't work anymore.
This PR adds the ability to render drops as JSON. You can safely run drop.to_json and it should Do the Right Thing.
2016-05-24 19:08:46 -05:00
Pat Hawks f7714add15 Add normalize_whitepace filter 2016-05-19 19:59:22 -07:00
Thomas Wood 66c4ff8800 Add a where_exp filter for filtering by expression
This commit introduces a where_exp filter, which can be used as follows:
  `{{ array | where_exp: "item", "item == 10" }}`
  `{{ array | where_exp: "item", "item.field > 10" }}`
  `{{ site.posts | where_exp: "post", "post contains 'field'" }}`
  `{{ site.posts | where_exp: "post", "post.array contains 'giraffes'" }}`

This permits a variety of use cases, such as reported in: jekyll#4467,
jekyll#4385, jekyll#2787.
2016-04-12 18:52:58 +01:00
jekyllbot 6ee728efcb Merge pull request #4537 from Crunch09/fix-warnings
Merge pull request 4537
2016-03-31 18:37:32 -07:00
Florian Thomas d213981a24 Fix warnings
This removes the following warnings:

- /lib/jekyll/configuration.rb:151: warning: instance variable @default_config_file not initialized
- /lib/jekyll/converter.rb:12: warning: instance variable @highlighter_prefix not initialized
- /lib/jekyll/converter.rb:24: warning: instance variable @highlighter_suffix not initialized
- /lib/jekyll/converters/markdown.rb:9: warning: instance variable @setup not initialized
- /lib/jekyll/converters/markdown/kramdown_parser.rb:60: warning: instance variable @highlighter not initialized
- /lib/jekyll/frontmatter_defaults.rb:97: warning: shadowing outer local variable - path
- /lib/jekyll/plugin.rb:66: warning: instance variable @safe not initialized
- /lib/jekyll/regenerator.rb:147: warning: instance variable @disabled not initialized
- /test/test_convertible.rb:40: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_filters.rb:154: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_new_command.rb:84: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_site.rb:234: warning: assigned but unused variable - site
- /test/test_site.rb:240: warning: assigned but unused variable - site
- /test/test_site.rb:522: warning: assigned but unused variable - source
- /test/test_tags.rb:153: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:425: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:449: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:496: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:496: warning: instance variable @result not initialized
- /test/test_tags.rb:511: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:773: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:773: warning: instance variable @result not initialized
- /test/test_tags.rb:788: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_url.rb:66: warning: shadowing outer local variable - doc
- /lib/jekyll/url.rb:119:in `escape_path': warning: URI.escape is obsolete
2016-03-25 22:03:17 +01:00
Pat Hawks aeecbd741f
Add test to inspect strings 2016-03-21 15:45:29 -07:00
jekyllbot 9e0ed00a59 Merge pull request #4555 from timwis/patch-1
Merge pull request 4555
2016-03-08 16:25:15 -08:00
timwis e130a0841f add test to ensure where doesn't match substrings 2016-03-03 15:56:54 -05:00
Parker Moore de8f67c4a2 Fix link issues in the site found by HTML Proofer. 2016-03-01 19:43:22 -08:00
jekyllbot c16a2f4d6a Merge pull request #4590 from tonyg/pr4582
Merge pull request 4590
2016-02-29 16:12:06 -08:00
Tony Garnock-Jones fa1eb68941 Fix for issue #4582, plus simple test 2016-02-26 11:06:03 -05:00
timwis 3fbca47b1a add test for group_by size property 2016-02-25 10:41:23 -05:00
timwis f5f8548eb8 add tests for where arrays 2016-02-25 10:24:47 -05:00
Parker Moore d929242e2b Permalinks which end in a slash should always output HTML
Duplicates #4493 for 3.1.1.

/cc @jekyll/core
2016-02-19 15:02:13 -08:00
jekyllbot 735554007c Merge pull request #4314 from jekyll/allow-custom-php-extensions
Merge pull request 4314
2016-01-09 18:11:47 -08:00
Pat Hawks ddf640e6bd
Test all the things 2016-01-08 17:10:36 -08:00
Pat Hawks acb2263f51
Add smartify filter 2016-01-07 02:36:24 -08:00
Parker Moore b6c283a4ae wip: allow custom extensions 2016-01-04 17:42:06 -08:00
Parker Moore 2e91d094e5 filters#sample: n == 1, return item; n > 1, return array 2015-12-04 10:25:13 -08:00
Parker Moore 86195655d7 filters: allow sample(n) instead of just sample(1) 2015-12-04 09:40:57 -08:00
Parker Moore 96bc62c666 Add 'sample' Liquid filter
Equivalent to Array#sample functionality
2015-12-04 09:33:33 -08:00
Parker Moore 4169075dd1 filters: `where` should compare stringified versions of input & comparator
Non-string input was being missed as a result of poor comparison.
Converting inputs to strings ensure numerical and boolean values are
properly compared.

Fixes #3911.
2015-08-25 23:00:58 -07:00
Martin Jorn Rogalla 92a9582733 Corrected error message as suggested by @parkr.
Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
2015-03-01 11:16:08 +01:00
Martin Jorn Rogalla 78af3c5018 Improved clarity of sort nil input error message.
Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
2015-03-01 09:51:59 +01:00
Martin Jorn Rogalla 0565308ce6 Added test to check on nil input for sort filter.
- Added a test to check if the sort filter will raise the correct
   exception on given nil input.
 - Improved error message and used "nil" consistently.

Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
2015-03-01 09:40:32 +01:00
Parker Moore 7ad0597bff Make our own Minitest::Test subclass for further subclassing 2015-02-21 00:33:47 -08:00
Parker Moore 4b59eb4175 Fix the test inheritance for the tests. 2015-02-20 13:35:02 -08:00
Parker Moore c1da91cf5c Start removing mentions of Textile. 2015-01-17 16:51:28 -08:00
Parker Moore 10659e1eef Merge branch 'nitoyon-slugify-new-param'
* nitoyon-slugify-new-param:
  Remove superfluous Sass declarations.
  Move the slugify options out to their own section so as to fix the formatting.
  Document the mode parameter of slugify Liquid filter
  Add tests for mode parameters of slugify Liquid filter
  Add mode parameter to slugify Liquid filter

Conflicts:
	lib/jekyll/utils.rb

        ---> Hadn't added UTF-8 support in nitoyon's PR.
2015-01-17 16:06:10 -08:00
Ryan Burnette 588bba39ad Add test for Date object in filters.rb 2015-01-13 13:51:36 -05:00
Parker Moore 9109da32f9 Update test for the date() Liquid filter. 2014-12-29 20:44:10 -05:00
Aidan Feldman 229303bbc8 compare resulting data in jsonify test 2014-11-27 04:01:31 -06:00
Aidan Feldman 0662d31bf6 fix jsonify filter when used with boolean values 2014-11-26 02:40:41 -06:00
Parker Moore 18930b01f6 Fix up the assertions. 2014-11-05 11:39:15 -08:00
Parker Moore b29fd6d380 Add tests.
Need to fix up the assertions to match the output.
2014-11-05 11:37:51 -08:00
Parker Moore 3fb1356593 The jsonify filter should deep-convert to Liquid when given an Array.
Fixes https://github.com/github/choosealicense.com/issues/225
2014-10-27 15:58:42 -07:00
nitoyon 3c5e9f5334 Add tests for mode parameters of slugify Liquid filter 2014-10-12 02:50:08 +09:00
Mike Kruk 56ac50c568 where filter - test return value when filtering a Hash 2014-10-08 17:02:36 -04:00
Mike Kruk f6ea8b4d50 Allow Enumerables to be used with "where" filter. 2014-10-08 16:19:55 -04:00
Parker Moore 196a56e3ec Add push, pop, shift, and unshift Liquid filters.
Fixes #2892.
2014-09-09 21:29:23 -07:00
Chris Frederick 77297744ce Add a test for the slugify Liquid filter 2014-09-07 16:49:14 +09:00
Shu Uesugi cfd17b2e7d Add inspect filter 2014-09-01 14:51:09 -07:00