Class: Gauge::Configuration Private

Inherits:
Object
  • Object
show all
Defined in:
lib/configuration.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Configuration.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/configuration.rb', line 54

def initialize
  @includes=[]
  @custom_screengrabber=false
  @screengrabber = -> {
    file_name = "#{Dir.tmpdir}/screenshot.png"
    `gauge_screenshot #{file_name}`
    file_content = File.binread(file_name)
    File.delete file_name
    return file_content
  }
end

Instance Attribute Details

#custom_screengrabberObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



66
67
68
# File 'lib/configuration.rb', line 66

def custom_screengrabber
  @custom_screengrabber
end

Class Method Details

.include_configured_modulesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
94
# File 'lib/configuration.rb', line 89

def self.include_configured_modules
  # include all modules that have been configured
  # TODO: move this feature to something more specific, ex look at supporting Sandboxed execution.
  main=TOPLEVEL_BINDING.eval('self')
  self.instance.includes.each &main.method(:include)
end

.instanceObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



68
69
70
# File 'lib/configuration.rb', line 68

def self.instance
  @configuration ||= Configuration.new
end

Instance Method Details

#include(*includes) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



72
73
74
# File 'lib/configuration.rb', line 72

def include(*includes)
  @includes.push *includes
end

#includesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



76
77
78
# File 'lib/configuration.rb', line 76

def includes
  @includes
end

#screengrabberObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



80
81
82
# File 'lib/configuration.rb', line 80

def screengrabber
  @screengrabber
end

#screengrabber=(block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



84
85
86
87
# File 'lib/configuration.rb', line 84

def screengrabber=(block)
  @custom_screengrabber=true
  @screengrabber=block
end