Module: CI::Queue

Extended by:
Queue
Included in:
Queue
Defined in:
lib/ci/queue.rb,
lib/ci/queue/file.rb,
lib/ci/queue/redis.rb,
lib/ci/queue/bisect.rb,
lib/ci/queue/static.rb,
lib/ci/queue/version.rb,
lib/ci/queue/redis/base.rb,
lib/ci/queue/redis/retry.rb,
lib/ci/queue/redis/worker.rb,
lib/ci/queue/configuration.rb,
lib/ci/queue/output_helpers.rb,
lib/ci/queue/redis/supervisor.rb

Defined Under Namespace

Modules: OutputHelpers, Redis Classes: Bisect, Configuration, File, Static

Constant Summary collapse

VERSION =
'0.10.0'
DEV_SCRIPTS_ROOT =
::File.expand_path('../../../../../redis', __FILE__)
RELEASE_SCRIPTS_ROOT =
::File.expand_path('../redis', __FILE__)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#shuffler ⇒ Object

Returns the value of attribute shuffler.



15
16
17
# File 'lib/ci/queue.rb', line 15

def shuffler
  @shuffler
end

Instance Method Details

#from_uri(url, config) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ci/queue.rb', line 25

def from_uri(url, config)
  uri = URI(url)
  implementation = case uri.scheme
  when 'list'
    Static
  when 'file', nil
    File
  when 'redis'
    require 'ci/queue/redis'
    Redis
  else
    raise ArgumentError, "Don't know how to handle #{uri.scheme} URLs"
  end
  implementation.from_uri(uri, config)
end

#shuffle(tests, random) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/ci/queue.rb', line 17

def shuffle(tests, random)
  if shuffler
    shuffler.call(tests, random)
  else
    tests.sort.shuffle(random: random)
  end
end