Module: AutoBrewster
- Defined in:
- lib/auto_brewster.rb,
lib/auto_brewster/cli.rb,
lib/auto_brewster/server.rb,
lib/auto_brewster/middleware.rb,
lib/auto_brewster/screenshot.rb
Defined Under Namespace
Classes: CLI, Middleware, Screenshot, Server
Class Attribute Summary collapse
-
.debug ⇒ Object
Returns the value of attribute debug.
-
.failfast ⇒ Object
Returns the value of attribute failfast.
-
.hostname ⇒ Object
Returns the value of attribute hostname.
-
.path ⇒ Object
Returns the value of attribute path.
-
.rackup_path ⇒ Object
Returns the value of attribute rackup_path.
-
.screen_widths ⇒ Object
Returns the value of attribute screen_widths.
-
.server(&block) ⇒ Object
Returns the value of attribute server.
-
.server_port ⇒ Object
Returns the value of attribute server_port.
-
.server_start ⇒ Object
Returns the value of attribute server_start.
-
.server_timeout ⇒ Object
Returns the value of attribute server_timeout.
-
.url_paths ⇒ Object
Returns the value of attribute url_paths.
Class Method Summary collapse
- .clear_source_screens ⇒ Object
- .compare_screens ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .generate_source_screens ⇒ Object
- .include_support_post_launch ⇒ Object
- .run_default_server(app, port) ⇒ Object
- .setup ⇒ Object
- .start_test_server ⇒ Object
Class Attribute Details
.debug ⇒ Object
Returns the value of attribute debug.
10 11 12 |
# File 'lib/auto_brewster.rb', line 10 def debug @debug end |
.failfast ⇒ Object
Returns the value of attribute failfast.
10 11 12 |
# File 'lib/auto_brewster.rb', line 10 def failfast @failfast end |
.hostname ⇒ Object
Returns the value of attribute hostname.
7 8 9 |
# File 'lib/auto_brewster.rb', line 7 def hostname @hostname end |
.path ⇒ Object
Returns the value of attribute path.
9 10 11 |
# File 'lib/auto_brewster.rb', line 9 def path @path end |
.rackup_path ⇒ Object
Returns the value of attribute rackup_path.
7 8 9 |
# File 'lib/auto_brewster.rb', line 7 def rackup_path @rackup_path end |
.screen_widths ⇒ Object
Returns the value of attribute screen_widths.
8 9 10 |
# File 'lib/auto_brewster.rb', line 8 def screen_widths @screen_widths end |
.server(&block) ⇒ Object
Returns the value of attribute server.
7 8 9 |
# File 'lib/auto_brewster.rb', line 7 def server @server end |
.server_port ⇒ Object
Returns the value of attribute server_port.
7 8 9 |
# File 'lib/auto_brewster.rb', line 7 def server_port @server_port end |
.server_start ⇒ Object
Returns the value of attribute server_start.
7 8 9 |
# File 'lib/auto_brewster.rb', line 7 def server_start @server_start end |
.server_timeout ⇒ Object
Returns the value of attribute server_timeout.
7 8 9 |
# File 'lib/auto_brewster.rb', line 7 def server_timeout @server_timeout end |
.url_paths ⇒ Object
Returns the value of attribute url_paths.
8 9 10 |
# File 'lib/auto_brewster.rb', line 8 def url_paths @url_paths end |
Class Method Details
.clear_source_screens ⇒ Object
31 32 33 34 |
# File 'lib/auto_brewster.rb', line 31 def clear_source_screens setup @screenshot.clear_source_screens end |
.compare_screens ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/auto_brewster.rb', line 23 def compare_screens setup @screenshot.clear_compare_screens start_test_server @screenshot.capture(:compare) @screenshot.compare_captured_screens end |
.configure {|_self| ... } ⇒ Object
12 13 14 |
# File 'lib/auto_brewster.rb', line 12 def configure yield self end |
.generate_source_screens ⇒ Object
41 42 43 44 45 |
# File 'lib/auto_brewster.rb', line 41 def generate_source_screens setup start_test_server @screenshot.capture(:source) end |
.include_support_post_launch ⇒ Object
61 62 63 |
# File 'lib/auto_brewster.rb', line 61 def include_support_post_launch Dir.glob("#{path}/support/post_launch/*.rb").map { |file| require file } end |
.run_default_server(app, port) ⇒ Object
55 56 57 58 59 |
# File 'lib/auto_brewster.rb', line 55 def run_default_server(app, port) require 'rack/handler/thin' Thin::Logging.silent = true unless debug Rack::Handler::Thin.run(app, :Port => port, :AccessLog => []) end |
.setup ⇒ Object
16 17 18 19 20 21 |
# File 'lib/auto_brewster.rb', line 16 def setup include_support_env include_support_pre_launch @server = AutoBrewster::Server.new(server, server_port, server_timeout, rackup_path, hostname) @screenshot = AutoBrewster::Screenshot.new(@server, path, url_paths, screen_widths) end |
.start_test_server ⇒ Object
36 37 38 39 |
# File 'lib/auto_brewster.rb', line 36 def start_test_server return unless AutoBrewster.server_start @server.start end |