aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler.rb
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2013-02-18 21:41:38 -0800
committerAndre Arko <andre@arko.net>2013-02-18 21:41:38 -0800
commitbfc0632ff891a9c33cf3caf3cae34d47875f8baf (patch)
tree12ef5acf55cb83a685ce86b698e80bf82f058b8d /lib/bundler.rb
parent332cd2f9dfab04e49330eac20ba8a0e3a3984c3b (diff)
downloadbundler-bfc0632ff891a9c33cf3caf3cae34d47875f8baf.tar.gz
abstract Marshal.load failures
Diffstat (limited to 'lib/bundler.rb')
-rw-r--r--lib/bundler.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 791a71cb..61fb7a07 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -81,6 +81,7 @@ module Bundler
end
class InvalidSpecSet < StandardError; end
+ class MarshalError < StandardError; end
class << self
attr_writer :ui, :bundle_path
@@ -284,6 +285,12 @@ module Bundler
File.open(file, "rb") { |f| f.read }
end
+ def load_marshal(data)
+ Marshal.load(data)
+ rescue => e
+ raise MarshalError, "#{e.class}: #{e.message}"
+ end
+
def load_gemspec(file)
@gemspec_cache ||= {}
key = File.expand_path(file)