Class: Gauge::Configuration Private
- Inherits:
-
Object
- Object
- Gauge::Configuration
- 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
- #custom_screengrabber ⇒ Object readonly private
Class Method Summary collapse
- .include_configured_modules ⇒ Object private
- .instance ⇒ Object private
Instance Method Summary collapse
- #include(*includes) ⇒ Object private
- #includes ⇒ Object private
-
#initialize ⇒ Configuration
constructor
private
A new instance of Configuration.
- #screengrabber ⇒ Object private
- #screengrabber=(block) ⇒ Object private
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 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_screengrabber ⇒ Object (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_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.
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 |
.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.
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 |
#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.
76 77 78 |
# File 'lib/configuration.rb', line 76 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.
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 |