Class: Steep::Daemon::Configuration
- Defined in:
- lib/steep/daemon/configuration.rb
Instance Attribute Summary collapse
-
#log_path ⇒ Object
readonly
Returns the value of attribute log_path.
-
#pid_path ⇒ Object
readonly
Returns the value of attribute pid_path.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#socket_dir ⇒ Object
readonly
Returns the value of attribute socket_dir.
-
#socket_path ⇒ Object
readonly
Returns the value of attribute socket_path.
Instance Method Summary collapse
-
#initialize(base_dir: Dir.pwd) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(base_dir: Dir.pwd) ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 15 16 |
# File 'lib/steep/daemon/configuration.rb', line 8 def initialize(base_dir: Dir.pwd) @socket_dir = File.join(Dir.tmpdir, "steep-server") @project_id = Digest::MD5.hexdigest(base_dir)[0, 8] #: String FileUtils.mkdir_p(@socket_dir) @socket_path = File.join(@socket_dir, "steep-#{@project_id}.sock") @pid_path = @socket_path.sub(".sock", ".pid") @log_path = @socket_path.sub(".sock", ".log") end |
Instance Attribute Details
#log_path ⇒ Object (readonly)
Returns the value of attribute log_path.
6 7 8 |
# File 'lib/steep/daemon/configuration.rb', line 6 def log_path @log_path end |
#pid_path ⇒ Object (readonly)
Returns the value of attribute pid_path.
6 7 8 |
# File 'lib/steep/daemon/configuration.rb', line 6 def pid_path @pid_path end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
6 7 8 |
# File 'lib/steep/daemon/configuration.rb', line 6 def project_id @project_id end |
#socket_dir ⇒ Object (readonly)
Returns the value of attribute socket_dir.
6 7 8 |
# File 'lib/steep/daemon/configuration.rb', line 6 def socket_dir @socket_dir end |
#socket_path ⇒ Object (readonly)
Returns the value of attribute socket_path.
6 7 8 |
# File 'lib/steep/daemon/configuration.rb', line 6 def socket_path @socket_path end |