Class: RibitConfig
- Inherits:
-
Object
- Object
- RibitConfig
- Defined in:
- lib/ribit/config.rb
Constant Summary collapse
- HTTP_PORT =
'http-port'- HTTP_HOST =
'http-host'- MOUNT_POINT =
'ribit-mount-point'- DATA_PATH =
'ribit-data-path'- DATA_RELOAD =
'ribit-data-reload'- USER_ID =
'uid'- GROUP_ID =
'gid'- PID_FILE =
'pid-file'- MAIN_PAGE =
'ribit-main-page'- CVSROOT =
'ribit-cvsroot'- PAGE_CACHE_DIR =
'ribit-page-cache-path'
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #get_base_url ⇒ Object
-
#initialize ⇒ RibitConfig
constructor
A new instance of RibitConfig.
Constructor Details
#initialize ⇒ RibitConfig
Returns a new instance of RibitConfig.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ribit/config.rb', line 41 def initialize @props = Hash.new @props[HTTP_PORT] = '8080' @props[HTTP_HOST] = 'localhost' @props[MOUNT_POINT] = '/ribit' @props[DATA_PATH] = './data' @props[DATA_RELOAD] = 'false' @props[CVSROOT] = nil @props[USER_ID] = nil @props[GROUP_ID] = nil @props[PID_FILE] = nil @props[MAIN_PAGE] = 'main::main' @props[PAGE_CACHE_DIR] = nil end |
Instance Method Details
#[](key) ⇒ Object
60 61 62 |
# File 'lib/ribit/config.rb', line 60 def []( key ) return @props[key] end |
#[]=(key, value) ⇒ Object
65 66 67 |
# File 'lib/ribit/config.rb', line 65 def []=( key, value ) @props[key] = value end |
#get_base_url ⇒ Object
70 71 72 |
# File 'lib/ribit/config.rb', line 70 def get_base_url return 'http://' + @props[HTTP_HOST] + ':' + @props[HTTP_PORT] + @props[MOUNT_POINT] end |