Instiki 0.16.3: Rails 2.3.0

Instiki now runs on the Rails 2.3.0 Candidate Release.
Among other improvements, this means that it now 
automagically selects between WEBrick and Mongrel.

Just run

    ./instiki --daemon
This commit is contained in:
Jacques Distler 2009-02-04 14:26:08 -06:00
parent 43aadecc99
commit 4e14ccc74d
893 changed files with 71965 additions and 28511 deletions

View file

@ -3,12 +3,23 @@ require 'yaml'
require 'optparse'
include_password = false
options = {}
OptionParser.new do |opt|
opt.banner = "Usage: dbconsole [options] [environment]"
opt.on("-p", "--include-password", "Automatically provide the password from database.yml") do |v|
include_password = true
end
opt.on("--mode [MODE]", ['html', 'list', 'line', 'column'],
"Automatically put the sqlite3 database in the specified mode (html, list, line, column).") do |mode|
options['mode'] = mode
end
opt.on("-h", "--header") do |h|
options['header'] = h
end
opt.parse!(ARGV)
abort opt.to_s unless (0..1).include?(ARGV.size)
end
@ -41,7 +52,7 @@ when "mysql"
if config['password'] && include_password
args << "--password=#{config['password']}"
elsif config['password'] && !config['password'].empty?
elsif config['password'] && !config['password'].to_s.empty?
args << "-p"
end
@ -60,8 +71,13 @@ when "sqlite"
exec(find_cmd('sqlite'), config["database"])
when "sqlite3"
exec(find_cmd('sqlite3'), config["database"])
args = []
args << "-#{options['mode']}" if options['mode']
args << "-header" if options['header']
args << config['database']
exec(find_cmd('sqlite3'), *args)
else
abort "Unknown command-line client for #{config['database']}. Submit a Rails patch to add support!"
end