lib/soywiki.rb in soywiki-0.2.2 vs lib/soywiki.rb in soywiki-0.2.3

- old
+ new

@@ -1,10 +1,11 @@ require 'string_ext' module Soywiki - VERSION = '0.2.2' + VERSION = '0.2.3' WIKI_WORD = /\b([a-z][\w_]+\.)?[A-Z][a-z]+[A-Z]\w*\b/ + HYPERLINK = %r|\bhttps?://[^ >)\n\]]+| def self.run if %W( -v --version -h --help).include?(ARGV.first) puts "soywiki #{Soywiki::VERSION}" puts "by Daniel Choi dhchoi@gmail.com" @@ -18,14 +19,25 @@ Specifying a wiki file is optional. If you don't specify a file, soywiki will open the most recently modified wiki file. --- END exit + elsif ARGV.first == '--html' + self.html_export + exit + else + vim = ENV['SOYWIKI_VIM'] || 'vim' + vimscript = File.expand_path("../soywiki.vim", __FILE__) + vim_command = "#{vim} -S #{vimscript} #{ARGV.first}" + exec vim_command end + end - vim = ENV['SOYWIKI_VIM'] || 'vim' - vimscript = File.expand_path("../soywiki.vim", __FILE__) - vim_command = "#{vim} -S #{vimscript} #{ARGV.first}" - exec vim_command + def self.html_export + require 'soywiki/html' + Html.export end end +if __FILE__ == $0 + Soywiki.run +end