From f298b96b345b4dff2fabf5dc789ae44a99deb444 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Thu, 25 Sep 2008 16:12:40 +0200 Subject: Use inject instead of nested calls for formatting --- trivium.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/trivium.rb b/trivium.rb index fc5d652..2470a00 100644 --- a/trivium.rb +++ b/trivium.rb @@ -91,12 +91,9 @@ class Dots < String end def format(e) - RubyPants.new( - BlueCloth.new( - Dots.new( - InlineMath.new( - e[:body] - ).to_html).to_html).to_html).to_html + [InlineMath, Dots, BlueCloth, RubyPants].inject(e[:body]) { |a,e| + e.new(a).to_html + } end def template(template, data) -- cgit 1.4.1