Method: Frameworks::EnvHelper#generate_base_urls
- Defined in:
- lib/frameworks/cucumber.rb
#generate_base_urls ⇒ Object
Generate base urls to use in Cucumber step defs
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/frameworks/cucumber.rb', line 8 def generate_base_urls environment = ENV['ENVIRONMENT'].downcase #be defensive prepare_host if(environment =='sandbox') @base_url = @sandbox + @bbc_domain @pal_base_url = @sandbox + @bbc_domain @ssl_base_url = @sslsandbox + @bbc_domain @static_base_url = @static_sandbox + @bbc_domain @mobile_base_url = @mobiledot_prefix + "sandbox.dev" + @bbc_domain @m_base_url = @mdot_prefix + "sandbox.dev" + @bbc_domain elsif(environment =='sandbox6') @base_url = @sandbox6 + @bbc_domain @pal_base_url = @sandbox6 + @bbc_domain @ssl_base_url = @sslsandbox6 + @bbc_domain @static_base_url = @static_sandbox6 + @bbc_domain @mobile_base_url = @mobiledot_prefix + "sandbox" + @bbc_domain @m_base_url = @mdot_prefix + "sandbox" + @bbc_domain elsif (environment =='live' && ENV['WWW_LIVE']=='false') @base_url = @www_prefix.chop + @bbc_domain @pal_base_url = @pal_prefix + environment + @bbc_domain @ssl_base_url = @ssl_prefix.chop + @bbc_domain @static_base_url = @static_prefix.chop + @bbci_domain @open_base_url = @open_prefix.chop + @bbc_domain @mobile_base_url = @mobiledot_prefix.chop + @bbc_domain @m_base_url = @mdot_prefix.chop + @bbc_domain else @base_url = @www_prefix + environment + @bbc_domain @pal_base_url = @pal_prefix + environment + @bbc_domain @ssl_base_url = @ssl_prefix + environment + @bbc_domain @static_base_url = @static_prefix + environment + @bbci_domain @static_base_url = @static_prefix.chop + @bbci_domain if environment == 'live' @open_base_url = @open_prefix + environment + @bbc_domain @mobile_base_url = @mobiledot_prefix + environment + @bbc_domain @m_base_url = @mdot_prefix + environment + @bbc_domain end proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] proxy_parts = proxy.scan(/(?:http:\/\/)?([^\:]+)(?::(\d+))?/) if proxy && !proxy.empty? if proxy_parts && !proxy_parts.empty? @proxy_host = proxy_parts[0][0] if proxy_parts[0][1] @proxy_port = proxy_parts[0][1] else @proxy_port = "80" end end end |