Class: Capybara::Webkit::Configuration
- Inherits:
-
Object
- Object
- Capybara::Webkit::Configuration
- Defined in:
- lib/capybara/webkit/configuration.rb
Instance Attribute Summary collapse
-
#allowed_urls ⇒ Object
Returns the value of attribute allowed_urls.
- #block_unknown_urls ⇒ Object
-
#blocked_urls ⇒ Object
Returns the value of attribute blocked_urls.
-
#debug ⇒ Object
Returns the value of attribute debug.
- #ignore_ssl_errors ⇒ Object
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#raise_javascript_errors ⇒ Object
Returns the value of attribute raise_javascript_errors.
- #skip_image_loading ⇒ Object
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Class Method Summary collapse
Instance Method Summary collapse
- #allow_unknown_urls ⇒ Object
- #allow_url(url) ⇒ Object
- #block_unknown_urls? ⇒ Boolean
- #block_url(url) ⇒ Object
- #ignore_ssl_errors? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #skip_image_loading? ⇒ Boolean
- #to_hash ⇒ Object
- #use_proxy(proxy) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/capybara/webkit/configuration.rb', line 35 def initialize @allowed_urls = [] @blocked_urls = [] @block_unknown_urls = false @debug = false @ignore_ssl_errors = false @proxy = nil @skip_image_loading = false @stderr = $stderr @timeout = -1 @raise_javascript_errors = false end |
Instance Attribute Details
#allowed_urls ⇒ Object
Returns the value of attribute allowed_urls.
24 25 26 |
# File 'lib/capybara/webkit/configuration.rb', line 24 def allowed_urls @allowed_urls end |
#block_unknown_urls ⇒ Object
56 57 58 |
# File 'lib/capybara/webkit/configuration.rb', line 56 def block_unknown_urls @block_unknown_urls = true end |
#blocked_urls ⇒ Object
Returns the value of attribute blocked_urls.
26 27 28 |
# File 'lib/capybara/webkit/configuration.rb', line 26 def blocked_urls @blocked_urls end |
#debug ⇒ Object
Returns the value of attribute debug.
27 28 29 |
# File 'lib/capybara/webkit/configuration.rb', line 27 def debug @debug end |
#ignore_ssl_errors ⇒ Object
68 69 70 |
# File 'lib/capybara/webkit/configuration.rb', line 68 def ignore_ssl_errors @ignore_ssl_errors = true end |
#proxy ⇒ Object
Returns the value of attribute proxy.
29 30 31 |
# File 'lib/capybara/webkit/configuration.rb', line 29 def proxy @proxy end |
#raise_javascript_errors ⇒ Object
Returns the value of attribute raise_javascript_errors.
33 34 35 |
# File 'lib/capybara/webkit/configuration.rb', line 33 def raise_javascript_errors @raise_javascript_errors end |
#skip_image_loading ⇒ Object
76 77 78 |
# File 'lib/capybara/webkit/configuration.rb', line 76 def skip_image_loading @skip_image_loading = true end |
#stderr ⇒ Object
Returns the value of attribute stderr.
30 31 32 |
# File 'lib/capybara/webkit/configuration.rb', line 30 def stderr @stderr end |
#timeout ⇒ Object
Returns the value of attribute timeout.
31 32 33 |
# File 'lib/capybara/webkit/configuration.rb', line 31 def timeout @timeout end |
Class Method Details
.modify ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/capybara/webkit/configuration.rb', line 16 def self.modify if instance.frozen? raise "All configuration must take place before the driver starts" else yield instance end end |
.to_hash ⇒ Object
12 13 14 |
# File 'lib/capybara/webkit/configuration.rb', line 12 def self.to_hash instance.freeze.to_hash end |
Instance Method Details
#allow_unknown_urls ⇒ Object
64 65 66 |
# File 'lib/capybara/webkit/configuration.rb', line 64 def allow_unknown_urls allow_url("*") end |
#allow_url(url) ⇒ Object
48 49 50 |
# File 'lib/capybara/webkit/configuration.rb', line 48 def allow_url(url) @allowed_urls << url end |
#block_unknown_urls? ⇒ Boolean
60 61 62 |
# File 'lib/capybara/webkit/configuration.rb', line 60 def block_unknown_urls? @block_unknown_urls end |
#block_url(url) ⇒ Object
52 53 54 |
# File 'lib/capybara/webkit/configuration.rb', line 52 def block_url(url) @blocked_urls << url end |
#ignore_ssl_errors? ⇒ Boolean
72 73 74 |
# File 'lib/capybara/webkit/configuration.rb', line 72 def ignore_ssl_errors? @ignore_ssl_errors end |
#skip_image_loading? ⇒ Boolean
80 81 82 |
# File 'lib/capybara/webkit/configuration.rb', line 80 def skip_image_loading? @skip_image_loading end |
#to_hash ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/capybara/webkit/configuration.rb', line 88 def to_hash { allowed_urls: allowed_urls, block_unknown_urls: block_unknown_urls?, blocked_urls: blocked_urls, debug: debug, ignore_ssl_errors: ignore_ssl_errors?, proxy: proxy, skip_image_loading: skip_image_loading?, stderr: stderr, timeout: timeout, raise_javascript_errors: raise_javascript_errors, } end |
#use_proxy(proxy) ⇒ Object
84 85 86 |
# File 'lib/capybara/webkit/configuration.rb', line 84 def use_proxy(proxy) @proxy = proxy end |