Sha256: 361e8a0996f5554b4ad44c071bbc4dc90c1e3dee44a414f4dab8abd659867e4b

Contents?: true

Size: 921 Bytes

Versions: 1

Compression:

Stored size: 921 Bytes

Contents

require 'string_ext'

module Soywiki
  VERSION = '0.4.7'
  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"
      puts
      puts <<END
---
Usage: soywiki 

Run the command in a directory you've made to contain soywiki files.

Soywiki will open the most recently modified wiki file or create a file
called main/HomePage. 
---
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}"
      exec vim_command
    end
  end

  def self.html_export
    require 'soywiki/html'
    Html.export
  end
end

if __FILE__ == $0
  Soywiki.run
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soywiki-0.4.7 lib/soywiki.rb