Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Installer#verify_spec
verify_spec
lib/rubygems/installer.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/installer.rb, line 717
def verify_spec
unless Gem::Specification::VALID_NAME_PATTERN.match?(spec.name)
raise Gem::InstallError, "#{spec} has an invalid name"
end
unless /\A#{Gem::Version::VERSION_PATTERN}\z/.match?(spec.version.to_s)
raise Gem::InstallError, "#{spec} has an invalid version"
end
unless /\A[\w.-]+\z/.match?(spec.platform.to_s)
raise Gem::InstallError, "#{spec.platform} is an invalid platform"
end
if spec.executables.any? {|name| !name.is_a?(String) || name != File.basename(name) || /\A\.\.?\z|\R/.match?(name) }
raise Gem::InstallError, "#{spec} has an invalid executable"
end
raise Gem::InstallError, "#{spec} has an invalid bindir" unless spec.bindir.is_a?(String)
expanded_gem_dir = File.expand_path(gem_dir)
expanded_bindir = File.expand_path(File.join(gem_dir, spec.bindir))
unless expanded_bindir == expanded_gem_dir || expanded_bindir.start_with?("#{expanded_gem_dir}/")
raise Gem::InstallError, "#{spec} has an invalid bindir"
end
end
No documentation available
See also
#user_install_dir
#windows_stub_script
#spec_file
#write_build_info_file
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0