module Runscope

Constants

VERSION

Public Class Methods

add_port_header_to_request(request, port) click to toggle source
# File lib/runscope-rb.rb, line 33
def self.add_port_header_to_request(request, port)
  headers = request.instance_variable_get('@header')
  request.instance_variable_set(
    '@header',
    headers.merge('Runscope-Request-Port' => "#{port}")
  )
  request
end
enabled?() click to toggle source
# File lib/runscope-rb.rb, line 46
def self.enabled?
  Runscope.enabled
end
is_non_standard_port?(port) click to toggle source
# File lib/runscope-rb.rb, line 42
def self.is_non_standard_port?(port)
  port != 443 && port != 80
end
monitor?(address) click to toggle source
# File lib/runscope-rb.rb, line 12
def self.monitor?(address)
  enabled? && monitor_domain?(address)
end
monitor_domain?(address) click to toggle source
# File lib/runscope-rb.rb, line 16
def self.monitor_domain?(address)
  raise NoDomainsSetError unless domains
  domains.any? do |domain|
    if domain.is_a?(String)
      address == domain
    elsif domain.is_a?(Regexp)
      address =~ domain
    end
  end
end
proxy_domain(address) click to toggle source
# File lib/runscope-rb.rb, line 27
def self.proxy_domain(address)
  raise BucketNotSetError unless bucket
  subdomain = address.gsub("-", "--").gsub(".", "-")
  "#{subdomain}-#{bucket}.runscope.net"
end
version_string() click to toggle source
# File lib/runscope-rb.rb, line 8
def self.version_string
  "Runscope version #{Runscope::VERSION}"
end