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.

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
# File 'lib/configuration.rb', line 54

def initialize
  @includes=[]
  @screengrabber = -> {
      file = File.open("#{Dir.tmpdir}/screenshot.png", "w+")
      `gauge_screenshot #{file.path}`
      file_content = File.binread(file.path)
      File.delete file
      return file_content
  }
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.



85
86
87
88
89
90
# File 'lib/configuration.rb', line 85

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.



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

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.



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

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.



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

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.



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

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.



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

def screengrabber=(block)
  @screengrabber=block
end