End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Command#get_one_gem_name
get_one_gem_name
lib/rubygems/command.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems/command.rb, line 216
def get_one_gem_name
args = options[:args]
if args.nil? || args.empty?
raise Gem::CommandLineError,
"Please specify a gem name on the command line (e.g. gem build GEMNAME)"
end
if args.size > 1
raise Gem::CommandLineError,
"Too many gem names (#{args.join(', ')}); please specify only one"
end
args.first
end
Get a single gem name from the command line. Fail if there is no gem name or if there is more than one gem name given.
See also
#get_all_gem_names_and_versions
#get_one_optional_argument
#get_all_gem_names
#handle_options
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0