Module: Logi::Command::Wiki
- Defined in:
- lib/logi/command/wiki.rb
Class Method Summary collapse
Class Method Details
.run(argv) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/logi/command/wiki.rb', line 8 def run argv return unless File.exist?(argv.first) puts File.read(argv.first).gsub(/\[\[(.+?)(\|(.+?))?\]\]/){ %Q{<a href="/#{CGI.escape_html($1)}.html">#{$3 || $1}</a>} } end |