class Nitra::Configuration
Attributes
debug[RW]
environment[RW]
framework[RW]
frameworks[RW]
print_failures[RW]
process_count[RW]
quiet[RW]
rake_tasks[RW]
slave_mode[RW]
slaves[RW]
Public Class Methods
new()
click to toggle source
# File lib/nitra/configuration.rb, line 8 def initialize self.environment = "nitra" self.slaves = [] self.rake_tasks = {} self.frameworks = [] calculate_default_process_count end
Public Instance Methods
add_framework(framework)
click to toggle source
# File lib/nitra/configuration.rb, line 16 def add_framework(framework) frameworks << framework end
add_rake_task(name, list)
click to toggle source
# File lib/nitra/configuration.rb, line 20 def add_rake_task(name, list) rake_tasks[name] = list end
add_slave(command)
click to toggle source
# File lib/nitra/configuration.rb, line 24 def add_slave(command) slaves << {:command => command, :cpus => nil} end
calculate_default_process_count()
click to toggle source
# File lib/nitra/configuration.rb, line 32 def calculate_default_process_count self.process_count ||= Nitra::Utils.processor_count end
set_default_framework()
click to toggle source
# File lib/nitra/configuration.rb, line 28 def set_default_framework self.framework = frameworks.first if frameworks.any? end
set_process_count(n)
click to toggle source
# File lib/nitra/configuration.rb, line 36 def set_process_count(n) if slaves.empty? self.process_count = n else slaves.last[:cpus] = n end end