Skip to content
Snippets Groups Projects
Commit 19d19564 authored by Thomas Wood's avatar Thomas Wood
Browse files

Update :gem:

parent f444b7bd
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ GEM ...@@ -16,7 +16,7 @@ GEM
citeproc (>= 1.0.2, < 2.0) citeproc (>= 1.0.2, < 2.0)
csl (~> 1.4) csl (~> 1.4)
coderay (1.1.1) coderay (1.1.1)
colorator (0.1) colorator (1.1.0)
colored (1.2) colored (1.2)
csl (1.4.4) csl (1.4.4)
namae (~> 0.7) namae (~> 0.7)
...@@ -25,6 +25,7 @@ GEM ...@@ -25,6 +25,7 @@ GEM
ethon (0.9.0) ethon (0.9.0)
ffi (>= 1.3.0) ffi (>= 1.3.0)
ffi (1.9.14) ffi (1.9.14)
forwardable-extended (2.6.0)
html-proofer (3.0.6) html-proofer (3.0.6)
activesupport (~> 4.2) activesupport (~> 4.2)
addressable (~> 2.3) addressable (~> 2.3)
...@@ -35,13 +36,14 @@ GEM ...@@ -35,13 +36,14 @@ GEM
typhoeus (~> 0.7) typhoeus (~> 0.7)
yell (~> 2.0) yell (~> 2.0)
i18n (0.7.0) i18n (0.7.0)
jekyll (3.1.6) jekyll (3.2.1)
colorator (~> 0.1) colorator (~> 1.0)
jekyll-sass-converter (~> 1.0) jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1) jekyll-watch (~> 1.1)
kramdown (~> 1.3) kramdown (~> 1.3)
liquid (~> 3.0) liquid (~> 3.0)
mercenary (~> 0.3.3) mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7) rouge (~> 1.7)
safe_yaml (~> 1.0) safe_yaml (~> 1.0)
jekyll-sass-converter (1.4.0) jekyll-sass-converter (1.4.0)
...@@ -51,7 +53,7 @@ GEM ...@@ -51,7 +53,7 @@ GEM
citeproc-ruby (~> 1.0) citeproc-ruby (~> 1.0)
csl-styles (~> 1.0) csl-styles (~> 1.0)
jekyll (~> 3.0) jekyll (~> 3.0)
jekyll-watch (1.4.0) jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1) listen (~> 3.0, < 3.1)
json (1.8.3) json (1.8.3)
kramdown (1.11.1) kramdown (1.11.1)
...@@ -70,6 +72,8 @@ GEM ...@@ -70,6 +72,8 @@ GEM
mini_portile2 (~> 2.1.0) mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7) pkg-config (~> 1.1.7)
parallel (1.9.0) parallel (1.9.0)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
pkg-config (1.1.7) pkg-config (1.1.7)
pry (0.10.4) pry (0.10.4)
coderay (~> 1.1.0) coderay (~> 1.1.0)
......
module Jekyll
module ExtraFilters
# Filters input against an arbitrary expression, where each item is assigned to variable
def where_exp(input, variable, expression)
c = parse_comparison(expression)
@context.stack do
input.select do |object|
@context[variable] = object
c.evaluate(@context)
end
end
end
private
def parse_comparison(exp)
p = Liquid::Parser.new(exp)
a = p.expression
if op = p.consume?(:comparison)
b = p.expression
c = Liquid::Condition.new(a, op, b)
else
c = Liquid::Condition.new(a)
end
p.consume(:end_of_string)
c
end
end
end
Liquid::Template.register_filter(Jekyll::ExtraFilters)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment