diff options
author | Hemant Kumar <gethemant@gmail.com> | 2013-07-22 09:10:28 +0530 |
---|---|---|
committer | Hemant Kumar <gethemant@gmail.com> | 2013-07-22 09:10:28 +0530 |
commit | 9187a2707878abd15a74fe09f1722ca0f8929724 (patch) | |
tree | e45264fafc2c9c5f390d98f1fbe972c7f5e43a9a /lib/bundler/safe_catch.rb | |
parent | 83e631bb81b278bdea802ee6129510f4712493d3 (diff) | |
download | bundler-9187a2707878abd15a74fe09f1722ca0f8929724.tar.gz |
Use regular catch/throw on platforms other than jruby
Diffstat (limited to 'lib/bundler/safe_catch.rb')
-rw-r--r-- | lib/bundler/safe_catch.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/bundler/safe_catch.rb b/lib/bundler/safe_catch.rb index ebfa54be..b71e51ad 100644 --- a/lib/bundler/safe_catch.rb +++ b/lib/bundler/safe_catch.rb @@ -26,11 +26,19 @@ module Bundler module SafeCatch def safe_catch(tag, &block) - Internal.catch(tag, &block) + if Bundler.current_ruby.jruby? + Internal.catch(tag, &block) + else + catch(tag, &block) + end end def safe_throw(tag, value = nil) - Internal.throw(tag, value) + if Bundler.current_ruby.jruby? + Internal.throw(tag, value) + else + throw(tag, value) + end end module Internal |