These are the defaults used by XSpec.dsl
, but feel free to specify your own
instead. They are set up in such a way that if you can override a component
down in the bowels without having to provide an entire top level scheduler.
require 'xspec/schedulers'
require 'xspec/evaluators'
require 'xspec/notifiers'
require 'digest/sha1'
module XSpec
def default_short_id(uow)
length = 3
base = 32
digest = Digest::SHA1.hexdigest(uow.full_name).hex
bottom = base ** (length-1)
top = base ** length
shifted = digest % (top - bottom) + bottom
shifted.to_s(base)
end
module_function :default_short_id
def add_defaults(options = {})