aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/safe_catch.rb
diff options
context:
space:
mode:
authorHemant Kumar <gethemant@gmail.com>2013-07-22 09:10:28 +0530
committerHemant Kumar <gethemant@gmail.com>2013-07-22 09:10:28 +0530
commit9187a2707878abd15a74fe09f1722ca0f8929724 (patch)
treee45264fafc2c9c5f390d98f1fbe972c7f5e43a9a /lib/bundler/safe_catch.rb
parent83e631bb81b278bdea802ee6129510f4712493d3 (diff)
downloadbundler-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.rb12
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