./pimki.rb in Pimki-1.5.092 vs ./pimki.rb in Pimki-1.6.092

- old
+ new

@@ -14,11 +14,12 @@ require_gem 'rubyzip' require 'zip/zip' rescue LoadError => detail # no rubygems, so load from the libraries directory - p detail + p detail if $DEBUG + puts 'Unable to load libraries through RubyGems. Loading from ./libraries directory' require 'bluecloth' require 'zip/zip' end # }}} @@ -45,11 +46,11 @@ OPTIONS = { :server_type => fork_available ? Daemon : SimpleServer, :port => 2500, :storage => "#{Dir.pwd}/storage", :pdflatex => pdflatex_available, - :redcloth => '2.0.11' + :redcloth => '3' } ARGV.options do |opts| script_name = File.basename($0) opts.banner = "Usage: ruby #{script_name} [options]" @@ -63,11 +64,11 @@ "Forces Instiki not to run as a Daemon if fork is available.\n" ) { OPTIONS[:server_type] = SimpleServer } opts.on("-t", "--storage=storage", String, "Makes Instiki use the specified directory for storage.", "Default: [cwd]/storage/[port]\n") { |OPTIONS[:storage]| } - opts.on("-r", "--redcloth VERSION", Integer, + opts.on("-r", "--redcloth VERSION", String, "Makes Instiki use the specified RedCloth version.", "You can specify major version only (2 or 3)", "Default: 2.0.11\n") { |OPTIONS[:redcloth]| } @@ -82,11 +83,15 @@ Socket.do_not_reverse_lookup = true #}}} # RedCloth + Modifications: {{{ begin - require_gem 'RedCloth', "~> #{OPTIONS[:redcloth]}" + if Gem.source_index.search('redcloth').map { |s| s.version.version }.include? OPTIONS[:redcloth] + require_gem 'RedCloth', "#{OPTIONS[:redcloth]}" + else + require_gem 'RedCloth', "~> #{OPTIONS[:redcloth]}" + end rescue LoadError => detail if OPTIONS[:redcloth] < '3' require 'redcloth_2.0.11' else @@ -146,10 +151,11 @@ text.strip! text end #}}} end #}}} end #}}} +puts RedCloth::VERSION # Start the application: {{{ storage_dir = OPTIONS[:storage] + "/" + OPTIONS[:port].to_s require 'fileutils' FileUtils.mkdir_p(storage_dir) @@ -157,10 +163,10 @@ WikiController.template_root = "#{cdir}/app/views/" on_exit = lambda { WebControllerServer::the_active_server.shutdown - MadeleineService.request_stop + WikiService.request_stop } trap "INT", on_exit trap "TERM", on_exit \ No newline at end of file