Skip to content

Commit

Permalink
Better detection of rbx and Typhoe...yeah i can't spell it
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Sep 16, 2012
1 parent f020cb1 commit 3a491b7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ gemspec

gem "rake", "~> 0.9.2"
gem "excon"
if !(RUBY_ENGINE =~ /rbx/)
gem "typhoeus"
end

group :test do
gem "rspec", "~> 2.11.0"
Expand All @@ -21,3 +18,7 @@ end
platforms :jruby do
gem "jruby-openssl"
end

platforms :ruby do
gem "typhoeus"
end
2 changes: 1 addition & 1 deletion lib/weary/adapters/typhoeus.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
begin
require 'typhoeus'
rescue LoadError => e
if RUBY_ENGINE =~ /rbx/
if defined? RUBY_ENGINE and 'rbx' == RUBY_ENGINE
warn "Typhoeus is not yet available on Rubinius: #{e.message}"
else
raise $!
Expand Down
9 changes: 7 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

WebMock.disable_net_connect!

def rbx?
defined? RUBY_ENGINE and 'rbx' == RUBY_ENGINE
end

RSpec.configure do |c|
c.filter_run_excluding :exclude_from_rbx => !!(RUBY_ENGINE =~ /rbx/)
end
c.filter_run_excluding :exclude_from_rbx => rbx?
end

0 comments on commit 3a491b7

Please sign in to comment.