okay now you can pass a block to `command` to tinker with the output
Chris Wanstrath chris@ozmm.org
Fri, 30 Oct 2009 23:43:44 -0700
1 files changed,
3 insertions(+),
2 deletions(-)
jump to
M
lib/github/markup.rb
→
lib/github/markup.rb
@@ -20,14 +20,15 @@ rescue LoadError
nil end - def command(command, regexp) + def command(command, regexp, &block) command = command.to_s if !File.exists?(command) && !command.include?('/') command = File.dirname(__FILE__) + '/commands/' + command.to_s end add_markup(regexp) do |content| - execute(command, content) + rendered = execute(command, content) + block ? block.call(rendered) : rendered end end