Class: Phut::Setting
- Inherits:
-
Object
- Object
- Phut::Setting
- Defined in:
- lib/phut/setting.rb
Overview
Central configuration repository.
Constant Summary collapse
- DEFAULTS =
{ root: File.(File.join(File.dirname(__FILE__), '..', '..')), pid_dir: Dir.tmpdir, log_dir: Dir.tmpdir, socket_dir: Dir.tmpdir }
Instance Method Summary collapse
-
#initialize ⇒ Setting
constructor
A new instance of Setting.
- #log_dir ⇒ Object
- #log_dir=(path) ⇒ Object
- #pid_dir ⇒ Object
- #pid_dir=(path) ⇒ Object
- #root ⇒ Object
- #socket_dir ⇒ Object
- #socket_dir=(path) ⇒ Object
Constructor Details
Instance Method Details
#log_dir ⇒ Object
31 32 33 |
# File 'lib/phut/setting.rb', line 31 def log_dir @options.fetch :log_dir end |
#log_dir=(path) ⇒ Object
35 36 37 38 |
# File 'lib/phut/setting.rb', line 35 def log_dir=(path) fail "No such directory: #{path}" unless FileTest.directory?(path) @options[:log_dir] = File.(path) end |
#pid_dir ⇒ Object
22 23 24 |
# File 'lib/phut/setting.rb', line 22 def pid_dir @options.fetch :pid_dir end |
#pid_dir=(path) ⇒ Object
26 27 28 29 |
# File 'lib/phut/setting.rb', line 26 def pid_dir=(path) fail "No such directory: #{path}" unless FileTest.directory?(path) @options[:pid_dir] = File.(path) end |
#root ⇒ Object
18 19 20 |
# File 'lib/phut/setting.rb', line 18 def root @options.fetch :root end |
#socket_dir ⇒ Object
40 41 42 |
# File 'lib/phut/setting.rb', line 40 def socket_dir @options.fetch :socket_dir end |
#socket_dir=(path) ⇒ Object
44 45 46 47 |
# File 'lib/phut/setting.rb', line 44 def socket_dir=(path) fail "No such directory: #{path}" unless FileTest.directory?(path) @options[:socket_dir] = File.(path) end |