Permalink
Browse files

okay now you can pass a block to `command` to tinker with the output

  • Loading branch information...
1 parent 3861e48 commit 8a8b52e3e33942a230102c7576a441f03721710f @defunkt defunkt committed Oct 31, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/github/markup.rb
View
@@ -20,14 +20,15 @@ def markup(file, pattern, &block)
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

0 comments on commit 8a8b52e

Please sign in to comment.