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

#initialize ⇒ Configuration

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=[]
  @screenshot_writer = true
  @custom_screengrabber = false
  @screengrabber = -> {
    file_name = Util.unique_screenshot_file
    `gauge_screenshot #{file_name}`
    return File.basename(file_name)
  }
end

Class Method Details

.include_configured_modules ⇒ 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.



104
105
106
107
108
109
# File 'lib/configuration.rb', line 104

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

.instance ⇒ 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.



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

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

Instance Method Details

#custom_screengrabber? ⇒ Boolean

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:

  • (Boolean)


96
97
98
# File 'lib/configuration.rb', line 96

def custom_screengrabber?
  @custom_screengrabber
end

#custom_screenshot_writer=(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.



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

def custom_screenshot_writer=(block)
  @screenshot_writer = true
  set_screengrabber(block)
end

#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

#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.



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

def includes
  @includes
end

#screengrabber ⇒ 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.



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

def screengrabber=(block)
  GaugeLog.warning("[DEPRECATED] Use custom_screenshot_writer instead.")
  @screenshot_writer = false
  set_screengrabber(block)
end

#screenshot_dir ⇒ 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.



100
101
102
# File 'lib/configuration.rb', line 100

def screenshot_dir
  ENV['gauge_screenshots_dir']
end

#screenshot_writer? ⇒ Boolean

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:

  • (Boolean)


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

def screenshot_writer?
  @screenshot_writer
end