method

verify_spec

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Installer
verify_spec() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/installer.rb, line 710
  def verify_spec
    unless spec.name =~ Gem::Specification::VALID_NAME_PATTERN
      raise Gem::InstallError, "#{spec} has an invalid name"
    end

    if spec.raw_require_paths.any?{|path| path =~ /\r\n|\r|\n/ }
      raise Gem::InstallError, "#{spec} has an invalid require_paths"
    end

    if spec.extensions.any?{|ext| ext =~ /\r\n|\r|\n/ }
      raise Gem::InstallError, "#{spec} has an invalid extensions"
    end

    unless spec.specification_version.to_s =~ /\A\d+\z/
      raise Gem::InstallError, "#{spec} has an invalid specification_version"
    end

    if spec.dependencies.any? {|dep| dep.type =~ /\r\n|\r|\n/ || dep.name =~ /\r\n|\r|\n/ }
      raise Gem::InstallError, "#{spec} has an invalid dependencies"
    end
  end
Register or log in to add new notes.