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.



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

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.



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

def daemonize
  @daemonize
end

#pidfileObject

Returns the value of attribute pidfile.



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

def pidfile
  @pidfile
end

#rsync_optionsObject

Returns the value of attribute rsync_options.



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

def rsync_options
  @rsync_options
end

#rsync_remote_pathObject

Returns the value of attribute rsync_remote_path.



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

def rsync_remote_path
  @rsync_remote_path
end

#slave_processesObject

Returns the value of attribute slave_processes.



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

def slave_processes
  @slave_processes
end

#userObject

Returns the value of attribute user.



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

def user
  @user
end

#worker_typeObject

Returns the value of attribute worker_type.



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

def worker_type
  @worker_type
end

#working_dirObject

Returns the value of attribute working_dir.



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

def working_dir
  @working_dir
end

Instance Method Details

#check_validityObject



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

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