Class: RRRSpec::Server::WorkerConfiguration

Inherits:
Configuration
  • Object
show all
Defined in:
lib/rrrspec/server/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorkerConfiguration

Returns a new instance of WorkerConfiguration.



41
42
43
44
45
46
# File 'lib/rrrspec/server/configuration.rb', line 41

def initialize
  super()
  @slave_processes = Facter.value(:processorcount).to_i
  @worker_type = 'default'
  @type = :worker
end

Instance Attribute Details

#daemonizeObject

Returns the value of attribute daemonize.



37
38
39
# File 'lib/rrrspec/server/configuration.rb', line 37

def daemonize
  @daemonize
end

#monitorObject

Returns the value of attribute monitor.



39
40
41
# File 'lib/rrrspec/server/configuration.rb', line 39

def monitor
  @monitor
end

#pidfileObject

Returns the value of attribute pidfile.



37
38
39
# File 'lib/rrrspec/server/configuration.rb', line 37

def pidfile
  @pidfile
end

#rsync_optionsObject

Returns the value of attribute rsync_options.



35
36
37
# File 'lib/rrrspec/server/configuration.rb', line 35

def rsync_options
  @rsync_options
end

#rsync_remote_pathObject

Returns the value of attribute rsync_remote_path.



35
36
37
# File 'lib/rrrspec/server/configuration.rb', line 35

def rsync_remote_path
  @rsync_remote_path
end

#slave_processesObject

Returns the value of attribute slave_processes.



36
37
38
# File 'lib/rrrspec/server/configuration.rb', line 36

def slave_processes
  @slave_processes
end

#stderr_pathObject

Returns the value of attribute stderr_path.



38
39
40
# File 'lib/rrrspec/server/configuration.rb', line 38

def stderr_path
  @stderr_path
end

#stdout_pathObject

Returns the value of attribute stdout_path.



38
39
40
# File 'lib/rrrspec/server/configuration.rb', line 38

def stdout_path
  @stdout_path
end

#userObject

Returns the value of attribute user.



37
38
39
# File 'lib/rrrspec/server/configuration.rb', line 37

def user
  @user
end

#worker_typeObject

Returns the value of attribute worker_type.



36
37
38
# File 'lib/rrrspec/server/configuration.rb', line 36

def worker_type
  @worker_type
end

#working_dirObject

Returns the value of attribute working_dir.



36
37
38
# File 'lib/rrrspec/server/configuration.rb', line 36

def working_dir
  @working_dir
end

Instance Method Details

#check_validityObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/rrrspec/server/configuration.rb', line 48

def check_validity
  validity = super

  unless rsync_remote_path and rsync_options
    $stderr.puts('The rsync options are not set')
    validity = false
  end

  unless working_dir and worker_type
    $stderr.puts('The worker options are not set')
    validity = false
  end

  validity
end