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.
Class Method Summary collapse
- .include_configured_modules ⇒ Object private
- .instance ⇒ Object private
Instance Method Summary collapse
- #custom_screengrabber? ⇒ Boolean private
- #custom_screenshot_writer=(block) ⇒ Object private
- #include(*includes) ⇒ Object private
- #includes ⇒ Object private
-
#initialize ⇒ Configuration
constructor
private
A new instance of Configuration.
- #screengrabber ⇒ Object private
- #screengrabber=(block) ⇒ Object private
- #screenshot_dir ⇒ Object private
- #screenshot_writer? ⇒ Boolean 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.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/configuration.rb', line 40 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.
90 91 92 93 94 95 |
# File 'lib/configuration.rb', line 90 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.
51 52 53 |
# File 'lib/configuration.rb', line 51 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.
82 83 84 |
# File 'lib/configuration.rb', line 82 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.
73 74 75 76 |
# File 'lib/configuration.rb', line 73 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.
55 56 57 |
# File 'lib/configuration.rb', line 55 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.
59 60 61 |
# File 'lib/configuration.rb', line 59 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.
63 64 65 |
# File 'lib/configuration.rb', line 63 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.
67 68 69 70 71 |
# File 'lib/configuration.rb', line 67 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.
86 87 88 |
# File 'lib/configuration.rb', line 86 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.
78 79 80 |
# File 'lib/configuration.rb', line 78 def screenshot_writer? @screenshot_writer end |