Skip to content

Commit

Permalink
Avoid installing HTTP libraries with native extensions for non-MRI
Browse files Browse the repository at this point in the history
In JRuby they don't work, and in Rubinius they have some problems as
well so we already skip testing a bunch of them in code.
  • Loading branch information
mislav committed Oct 6, 2015
1 parent 5a815fb commit c87d158
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
7 changes: 7 additions & 0 deletions Gemfile
Expand Up @@ -5,3 +5,10 @@ gem "faraday", ">= 0.9.2"
gemspec gemspec


gem 'jruby-openssl', :platforms => :jruby gem 'jruby-openssl', :platforms => :jruby

platform :mri do
gem "typhoeus"
gem "patron"
gem "em-http-request"
gem "curb"
end
5 changes: 5 additions & 0 deletions Gemfile.faraday-0.8
Expand Up @@ -3,3 +3,8 @@ source "https://rubygems.org"
gem "faraday", "~> 0.8.8" gem "faraday", "~> 0.8.8"


gemspec gemspec

platform :mri do
gem "typhoeus"
gem "patron"
end
16 changes: 10 additions & 6 deletions spec/monkey_patches.rb
@@ -1,5 +1,3 @@
require 'typhoeus'

module MonkeyPatches module MonkeyPatches
extend self extend self


Expand Down Expand Up @@ -134,10 +132,16 @@ def realias_net_http(alias_extension)
# for WebMock to work with them. # for WebMock to work with them.
require 'httpclient' require 'httpclient'


unless RUBY_INTERPRETER == :jruby if RUBY_INTERPRETER == :mri
require 'patron' require 'typhoeus'
require 'em-http-request' begin
require 'curb' require 'patron'
require 'em-http-request'
require 'curb'
rescue LoadError
# these are not always available, depending on the Gemfile used
warn $!.message
end
end end


if defined?(::Typhoeus.before) if defined?(::Typhoeus.before)
Expand Down
4 changes: 0 additions & 4 deletions vcr.gemspec
Expand Up @@ -39,10 +39,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "timecop" spec.add_development_dependency "timecop"
spec.add_development_dependency "multi_json" spec.add_development_dependency "multi_json"
spec.add_development_dependency "json" spec.add_development_dependency "json"
spec.add_development_dependency "typhoeus"
spec.add_development_dependency "patron"
spec.add_development_dependency "em-http-request"
spec.add_development_dependency "curb"
spec.add_development_dependency "yajl-ruby" spec.add_development_dependency "yajl-ruby"
spec.add_development_dependency "relish" spec.add_development_dependency "relish"
spec.add_development_dependency "mime-types" spec.add_development_dependency "mime-types"
Expand Down

0 comments on commit c87d158

Please sign in to comment.