Class: SpecRunQueue::Queue::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/spec_run_queue/queue/base.rb

Direct Known Subclasses

Redis

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
# File 'lib/spec_run_queue/queue/base.rb', line 6

def initialize(runner)
  @runner = runner
  connect
  reset_queue
end

Instance Attribute Details

#runnerObject (readonly)

Returns the value of attribute runner.



4
5
6
# File 'lib/spec_run_queue/queue/base.rb', line 4

def runner
  @runner
end

Class Method Details

.run_rescue_exceptionsObject



22
23
24
# File 'lib/spec_run_queue/queue/base.rb', line 22

def self.run_rescue_exceptions
  []
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
# File 'lib/spec_run_queue/queue/base.rb', line 12

def run
  with_reconnect do
    while (raw_instruction = queue_fetch)
      raise "Dangerous yaml!" if raw_instruction[1] =~ /!ruby/
      instruction = YAML.load(raw_instruction[1])
      runner.run_spec(instruction)
    end
  end
end