Class: M2Config::Server
- Inherits:
-
Object
- Object
- M2Config::Server
- Defined in:
- lib/m2config/server.rb
Constant Summary collapse
- ACCESS_LOG =
'/logs/access.log'- ERROR_LOG =
'/logs/error.log'- PID_FILE =
'/run/mongrel2.pid'- CHROOT =
'./'- DEFAULT_HOST =
'localhost'- NAME =
'main'- BIND_ADDR =
'0.0.0.0'- PORT =
6767- USE_SSL =
0
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(fields = {}) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(fields = {}) ⇒ Server
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/m2config/server.rb', line 15 def initialize( fields={} ) fields[:uuid] ||= UUID.new.generate fields[:access_log] ||= M2Config::Server::ACCESS_LOG fields[:error_log] ||= ERROR_LOG fields[:pid_file] ||= PID_FILE fields[:chroot] ||= CHROOT fields[:default_host] ||= DEFAULT_HOST fields[:name] ||= NAME fields[:bind_addr] ||= BIND_ADDR fields[:port] ||= PORT fields[:use_ssl] ||= USE_SSL super fields, false save end |
Class Method Details
.first ⇒ Object
30 31 32 33 34 |
# File 'lib/m2config/server.rb', line 30 def self.first raise "Careful ! You are calling Server.first on a database holding multiple servers" if ((Server.get {count(id)}) > 1) super end |