Class: Coursemology::Evaluator::Services::EvaluateProgrammingPackageService

Inherits:
Object
  • Object
show all
Defined in:
lib/coursemology/evaluator/services/evaluate_programming_package_service.rb

Defined Under Namespace

Classes: Result

Constant Summary collapse

HOME_PATH =

The path to the Coursemology user home directory.

'/home/coursemology'.freeze
PACKAGE_PATH =

The path to where the package will be extracted.

File.join(HOME_PATH, 'package')
REPORT_PATH =

The path to where the test report will be at.

File.join(PACKAGE_PATH, 'report.xml')
MEMORY_LIMIT_RATIO =

The ratio to multiply the memory limits from our evaluation to the container by.

1.megabyte / 1.kilobyte

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(evaluation) ⇒ EvaluateProgrammingPackageService

Creates a new service object.



28
29
30
31
# File 'lib/coursemology/evaluator/services/evaluate_programming_package_service.rb', line 28

def initialize(evaluation)
  @evaluation = evaluation
  @package = evaluation.package
end

Class Method Details

.execute(evaluation) ⇒ Coursemology::Evaluator::Services::EvaluateProgrammingPackageService::Result

Executes the given package in a container.

Parameters:

Returns:



23
24
25
# File 'lib/coursemology/evaluator/services/evaluate_programming_package_service.rb', line 23

def self.execute(evaluation)
  new(evaluation).send(:execute)
end