class String def is_namespaced? self.split(/\.|\//).size == 2 end alias :namespaced? :is_namespaced? # TODO change this to a Windows compatible approach def to_file_path self.gsub(".", "/") end def to_page_title self.gsub("/", ".") end def short_page_title self.to_page_title.split('.')[1] end def namespace return nil unless self.namespaced? self.to_page_title.split('.')[0] end end module Soywiki VERSION = '0.0.3' WIKI_WORD = /\b([a-z][\w_]+\.)?[A-Z][a-z]+[A-Z]\w*\b|\.[A-Z][a-z]+[A-Z]\w*\b/ 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 <