Class: ProxyTester::CapybaraProxy
- Inherits:
-
Object
- Object
- ProxyTester::CapybaraProxy
- Defined in:
- lib/proxy_tester/capybara_proxy.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
-
#type ⇒ Object
Returns the value of attribute type.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 5 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 6 def port @port end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 6 def type @type end |
#user ⇒ Object
Returns the value of attribute user.
5 6 7 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 5 def user @user end |
Instance Method Details
#as_phantomjs_arguments ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 37 def as_phantomjs_arguments result = [] result << "--proxy=#{to_connect}" if host || port result << "--proxy-type=#{type}" if type result << "--proxy-auth=#{user.to_login(cleartext: true)}" if user result end |
#blank? ⇒ Boolean
46 47 48 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 46 def blank? host.blank? and port.blank? end |
#to_connect ⇒ Object
50 51 52 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 50 def to_connect "#{host}:#{port}".shellescape end |
#to_sym ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/proxy_tester/capybara_proxy.rb', line 25 def to_sym return :no_proxy if host.blank? or port.blank? result = [] result << host result << port result << user.name unless user.blank? result.join('_').to_sym end |