method

spec_from_gem

spec_from_gem(path, policy = nil)
public

No documentation available.

# File lib/bundler/rubygems_integration.rb, line 304
    def spec_from_gem(path, policy = nil)
      require "rubygems/security"
      require "bundler/psyched_yaml"
      gem_from_path(path, security_policies[policy]).spec
    rescue Gem::Package::FormatError
      raise GemspecError, "Could not read gem at #{path}. It may be corrupted."
    rescue Exception, Gem::Exception, Gem::Security::Exception => e
      if e.is_a?(Gem::Security::Exception) ||
          e.message =~ /unknown trust policy|unsigned gem/ ||
          e.message =~ /couldn't verify (meta)?data signature/
        raise SecurityError,
          "The gem #{File.basename(path, ".gem")} can't be installed because "            "the security policy didn't allow it, with the message: #{e.message}"
      else
        raise e
      end
    end