lib/spiderfw/config/options/spider.rb in spiderfw-0.5.7 vs lib/spiderfw/config/options/spider.rb in spiderfw-0.5.9
- old
+ new
@@ -8,19 +8,28 @@
# config_option('storage.type', '')
# config_option('storage.url', '')
# Web server
config_option 'http.server', _("The internal server to use"), {
- :default => 'mongrel'
+ :default => lambda{
+ begin
+ require 'rubygems'
+ require 'mongrel'
+ 'mongrel'
+ rescue LoadError
+ 'webrick'
+ end
+ },
+ :type => String, :choices => ['webrick', 'mongrel', 'thin']
}
config_option 'webserver.show_traces', _("Whether to show the stack trace on error"), {
:default => Proc.new{ ['test', 'devel'].include?(Spider.config.get('runmode')) ? true : false }
}
config_option 'webserver.reload_sources', _("Reload application and spider sources on each request"), {
:default => Proc.new{ Spider.config.get('runmode') == 'devel' ? true : false }
}
- config_option 'webserver.port', _("Port to use for the http server"), :default => 8080
+ config_option 'webserver.port', _("Port to use for the http server"), :type => Fixnum, :default => 8080
config_option 'webserver.force_threads', _("Force threading on non-threaded adapters"),
:default => Proc.new{ RUBY_VERSION_PARTS[1] == '8' ? true : false }
config_option 'webserver.timeout', _("Time allowed for each request (in seconds)"), :type=> Fixnum, :default => nil
# Client
config_option 'client.text_editor', _("The text editor installed on the client")
@@ -45,10 +54,11 @@
}
config_option 'storages', _("A list of named storages"), :type => :conf
config_option 'storages.x.url', _("Connection url to the storage"), :type => String, :required => true
config_option 'storages.x.encoding', _("Encoding the DB uses"), :type => String
+ config_option 'storages.x.enable_transactions', _("Whether to enable transactions on the db"), :type => Spider::DataTypes::Bool, :default => true
config_option 'debugger.start', _("Start the debugger")
config_option 'profiling.enable', _("Enable on-request profiling")
config_option 'request.mutex', _("Respond to requests sequentially"), :default => false
@@ -67,20 +77,22 @@
config_option 'shared_store.type', _("Which shared store to use"), :default => 'memory'
config_option 'http.nonce_life', _("Life in seconds of HTTP Digest Authentication nonces"), :type => Fixnum, :default => 60
# TODO: implement in webrick/others, check if has a performance gain
- config_option 'http.auto_headers', _("Automatically send headers on first output (breaks the debugger)"), :default => true
+ config_option 'http.auto_headers', _("Automatically send headers on first output"),
+ :type => Spider::DataTypes::Bool, :default => true
config_option 'http.seize_stdout', _("Redirect standard output to the browser"), :default => false
config_option 'http.proxy_mapping', _("If the request is proxyied, the urls used to reach spider, with the corresponding paths called by the proxy"),
:type => Hash
config_option 'http.charset', _("The charset to use for http requests"), :default => 'UTF-8'
config_option 'debug.console.level', _("Level of debug output to console"), :default => :INFO,
- :process => lambda{ |opt| opt && opt != 'false' ? opt.to_s.upcase.to_sym : false }
- config_option 'log.errors', _("Log errors to file"), :default => true
+ :process => lambda{ |opt| opt && opt != 'false' ? opt.to_s.upcase.to_sym : false },
+ :choices => [false, :DEBUG, :WARN, :INFO, :ERROR]
+ config_option 'log.errors', _("Log errors to file"), :type => Spider::DataTypes::Bool, :default => true
config_option 'log.debug.level', _("Log level to use for debug file (false for no debug)"), :default => false,
- :choices => [false, :DEBUG, :INFO],
+ :choices => [false, :DEBUG, :WARN, :INFO, :ERROR],
:process => lambda{ |opt| opt && opt != 'false' ? opt.to_s.upcase.to_sym : false }
config_option 'log.rotate.age', _("Number of old log files to keep, OR frequency of rotation (daily, weekly or monthly)"), :default => 'daily'
config_option 'log.rotate.size', _("Maximum logfile size (only applies when log.rotate.age is a number)"), :default => 1048576
# :process => lambda{ |v| v.upcase }