diff options
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/dsl.rb | 17 | ||||
-rw-r--r-- | lib/bundler/source/path.rb | 3 |
2 files changed, 2 insertions, 18 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index cd0c80b3ff..84fafa7d62 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -48,7 +48,7 @@ module Bundler case gemspecs.size when 1 - spec = load_valid_gemspec(gemspecs.first) + spec = Bundler.load_and_validate_gemspec(gemspecs.first) gem spec.name, :path => path, :glob => glob @@ -360,21 +360,6 @@ module Bundler end end - def load_valid_gemspec(path) - spec = Bundler.load_gemspec(path) - - unless spec - raise InvalidOption, "There was an error loading the gemspec at " \ - "#{path}. Make sure you can build the gem, then try again." - end - - spec.validate - spec - rescue Gem::InvalidSpecificationException => e - raise InvalidOption, "The gemspec at #{path} is not valid. " \ - "The validation error was '#{e.message}'" - end - class DSLError < GemfileError # @return [String] the description that should be presented to the user. # diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index 862fbcb97a..9d2cbb708d 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -132,8 +132,7 @@ module Bundler if File.directory?(expanded_path) # We sort depth-first since `<<` will override the earlier-found specs Dir["#{expanded_path}/#{@glob}"].sort_by { |p| -p.split(File::SEPARATOR).size }.each do |file| - spec = Bundler.load_gemspec(file) - if spec + if spec = Bundler.load_and_validate_gemspec(file, true) spec.loaded_from = file.to_s spec.source = self index << spec |