Class: Steep::Daemon::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/daemon/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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_pathObject (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_idObject (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_dirObject (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_pathObject (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