Class: Headless

Inherits:
Object
  • Object
show all
Defined in:
lib/headless/core_ext/random_display.rb

Overview

Redifinition of the Headless class, which works as a wrapper arround Xvfb.

Since:

  • 1.1.0

Instance Method Summary collapse

Instance Method Details

#old_pick_available_displayObject

Link to original implemenmtarion of Headless#pick_available_display

Since:

  • 1.1.0



8
# File 'lib/headless/core_ext/random_display.rb', line 8

alias_method :old_pick_available_display, :pick_available_display

#pick_available_display(display_set, can_reuse) ⇒ Object

Shuffles the original display set generated by Headless. This makes the display picking random while still using the original avalability check algorithm.

Since:

  • 1.1.0



12
13
14
# File 'lib/headless/core_ext/random_display.rb', line 12

def pick_available_display(display_set, can_reuse)
  old_pick_available_display display_set.to_a.shuffle, can_reuse
end