End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::QueryUtils#installed?
installed?(name, req = Gem::Requirement.default)
lib/rubygems/query_utils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/query_utils.rb, line 180
def installed?(name, req = Gem::Requirement.default)
Gem::Specification.any? {|s| s.name =~ name and req =~ s.version }
end
Check if gem name version version is installed.
See also
#gem_name?
#make_entry
#execute
#output_query_results
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1