Class: Swee::Config::ServerConfig
- Inherits:
-
BaseConfig
- Object
- BaseConfig
- Swee::Config::ServerConfig
- Defined in:
- lib/swee/config.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
-
#code_reload ⇒ Object
Returns the value of attribute code_reload.
-
#env ⇒ Object
Returns the value of attribute env.
-
#handle_request_mode ⇒ Object
Returns the value of attribute handle_request_mode.
-
#listen ⇒ Object
Returns the value of attribute listen.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#logger_level ⇒ Object
Returns the value of attribute logger_level.
-
#max_connections ⇒ Object
Returns the value of attribute max_connections.
-
#performance_monitoring ⇒ Object
Returns the value of attribute performance_monitoring.
-
#pid_file ⇒ Object
Returns the value of attribute pid_file.
-
#restart_mode ⇒ Object
Returns the value of attribute restart_mode.
-
#run_background ⇒ Object
Returns the value of attribute run_background.
-
#touch_file ⇒ Object
Returns the value of attribute touch_file.
Instance Method Summary collapse
Methods inherited from BaseConfig
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd.
27 28 29 |
# File 'lib/swee/config.rb', line 27 def cmd @cmd end |
#code_reload ⇒ Object
Returns the value of attribute code_reload.
19 20 21 |
# File 'lib/swee/config.rb', line 19 def code_reload @code_reload end |
#env ⇒ Object
Returns the value of attribute env.
17 18 19 |
# File 'lib/swee/config.rb', line 17 def env @env end |
#handle_request_mode ⇒ Object
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 |
#listen ⇒ Object
Returns the value of attribute listen.
15 16 17 |
# File 'lib/swee/config.rb', line 15 def listen @listen end |
#log_file ⇒ Object
Returns the value of attribute log_file.
23 24 25 |
# File 'lib/swee/config.rb', line 23 def log_file @log_file end |
#logger_level ⇒ Object
Returns the value of attribute logger_level.
18 19 20 |
# File 'lib/swee/config.rb', line 18 def logger_level @logger_level end |
#max_connections ⇒ Object
Returns the value of attribute max_connections.
24 25 26 |
# File 'lib/swee/config.rb', line 24 def max_connections @max_connections end |
#performance_monitoring ⇒ Object
Returns the value of attribute performance_monitoring.
25 26 27 |
# File 'lib/swee/config.rb', line 25 def performance_monitoring @performance_monitoring end |
#pid_file ⇒ Object
Returns the value of attribute pid_file.
22 23 24 |
# File 'lib/swee/config.rb', line 22 def pid_file @pid_file end |
#restart_mode ⇒ Object
Returns the value of attribute restart_mode.
20 21 22 |
# File 'lib/swee/config.rb', line 20 def restart_mode @restart_mode end |
#run_background ⇒ Object
Returns the value of attribute run_background.
26 27 28 |
# File 'lib/swee/config.rb', line 26 def run_background @run_background end |
#touch_file ⇒ Object
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! @listen = ( [:listen] || 3000 ) @handle_request_mode ||= :event_loop @env = ( [:env] || :development ) @logger_level ||= :debug @code_reload ||= true @restart_mode ||= :pid @touch_file ||= File.("./tmp/restart.txt",ENV["app_path"]) @pid_file ||= File.("./tmp/pid",ENV["app_path"]) @log_file ||= [ File.("./logs/#{env.to_s}.log",ENV["app_path"]), 10, 10240000 ] @max_connections ||= 1024 @performance_monitoring ||= false @run_background ||= false @cmd = [:cmd] end |