Class: Swee::Config::ServerConfig

Inherits:
BaseConfig show all
Defined in:
lib/swee/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseConfig

#[], #absolutely_app_path

Instance Attribute Details

#cmdObject

Returns the value of attribute cmd.



27
28
29
# File 'lib/swee/config.rb', line 27

def cmd
  @cmd
end

#code_reloadObject

Returns the value of attribute code_reload.



19
20
21
# File 'lib/swee/config.rb', line 19

def code_reload
  @code_reload
end

#envObject

Returns the value of attribute env.



17
18
19
# File 'lib/swee/config.rb', line 17

def env
  @env
end

#handle_request_modeObject

Returns the value of attribute handle_request_mode.



16
17
18
# File 'lib/swee/config.rb', line 16

def handle_request_mode
  @handle_request_mode
end

#listenObject

Returns the value of attribute listen.



15
16
17
# File 'lib/swee/config.rb', line 15

def listen
  @listen
end

#log_fileObject

Returns the value of attribute log_file.



23
24
25
# File 'lib/swee/config.rb', line 23

def log_file
  @log_file
end

#logger_levelObject

Returns the value of attribute logger_level.



18
19
20
# File 'lib/swee/config.rb', line 18

def logger_level
  @logger_level
end

#max_connectionsObject

Returns the value of attribute max_connections.



24
25
26
# File 'lib/swee/config.rb', line 24

def max_connections
  @max_connections
end

#performance_monitoringObject

Returns the value of attribute performance_monitoring.



25
26
27
# File 'lib/swee/config.rb', line 25

def performance_monitoring
  @performance_monitoring
end

#pid_fileObject

Returns the value of attribute pid_file.



22
23
24
# File 'lib/swee/config.rb', line 22

def pid_file
  @pid_file
end

#restart_modeObject

Returns the value of attribute restart_mode.



20
21
22
# File 'lib/swee/config.rb', line 20

def restart_mode
  @restart_mode
end

#run_backgroundObject

Returns the value of attribute run_background.



26
27
28
# File 'lib/swee/config.rb', line 26

def run_background
  @run_background
end

#touch_fileObject

Returns the value of attribute touch_file.



21
22
23
# File 'lib/swee/config.rb', line 21

def touch_file
  @touch_file
end

Instance Method Details

#default_config!(options) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/swee/config.rb', line 29

def default_config! options
  @listen = ( options[:listen] || 3000 )
  @handle_request_mode  ||= :event_loop
  @env = ( options[:env] || :development )
  @logger_level ||= :debug
  @code_reload ||= true
  @restart_mode ||= :pid
  @touch_file ||= File.expand_path("./tmp/restart.txt",ENV["app_path"])
  @pid_file ||= File.expand_path("./tmp/pid",ENV["app_path"])
  @log_file ||= [ File.expand_path("./logs/#{env.to_s}.log",ENV["app_path"]), 10, 10240000 ]
  @max_connections ||= 1024
  @performance_monitoring ||= false
  @run_background ||= false
  @cmd = options[:cmd]
end