suite_condition("Typhoeus excluded on 1.8.7") do
  # Under Ruby 1.8.7 there are periodic segfaults with Typhoeus
  # and the Ruby agent. This predated our Typhoeus instrumentation, but given
  # usage levels and obscurity of the issue, it isn't worth deeper digging.
  # Just use >= 1.9
  RUBY_VERSION > '1.8.7'
end

gemfile <<-RB
  gem 'typhoeus', '~> 0.7.1'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]

  # We try translating URIs through Addressable if it's there, so test with it.
  gem 'addressable', :require => 'addressable/uri'
RB

gemfile <<-RB
  gem 'typhoeus', '~> 0.7.1'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]
RB

gemfile <<-RB
  gem 'typhoeus', '~> 0.6.9'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]
RB

gemfile <<-RB
  # Compatibility issues with ethon 0.5.12 https://github.com/typhoeus/ethon/issues/51
  gem 'ethon', '0.5.11'

  # ethon 0.5.11 requires mime-types ~> 1.18
  # normally, this wouldn't be a problem, but
  # we have other checks to work around other
  # mime-type dependency issues, so we need
  # to specify it here.
  gem 'mime-types', '~> 1.18'

  gem 'typhoeus', '~> 0.5.4'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]
RB

# Earliest supported version
gemfile <<-RB
  # Compatibility issues with ethon 0.5.12 https://github.com/typhoeus/ethon/issues/51
  gem 'ethon', '0.5.11'

  # ethon 0.5.11 requires mime-types ~> 1.18
  # normally, this wouldn't be a problem, but
  # we have other checks to work around other
  # mime-type dependency issues, so we need
  # to specify it here.
  gem 'mime-types', '~> 1.18'

  gem 'typhoeus', '0.5.3'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]
RB

# Prior to supported versions
gemfile <<-RB
  # Compatibility issues with ethon 0.5.12 https://github.com/typhoeus/ethon/issues/51
  gem 'ethon', '0.5.11'

  # ethon 0.5.11 requires mime-types ~> 1.18
  # normally, this wouldn't be a problem, but
  # we have other checks to work around other
  # mime-type dependency issues, so we need
  # to specify it here.
  gem 'mime-types', '~> 1.18'

  gem 'typhoeus', '0.5.2'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]
RB
