Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Specification#licenses=
licenses=(licenses)
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/specification.rb, line 385
def licenses=(licenses)
@licenses = Array licenses
end
The license(s) for the library.
Each entry must be a single SPDX license identifier, no more than 64 characters. Entries are validated independently, so a compound expression such as MIT OR Apache-2.0 is not valid as an entry. Listing the identifiers as separate array elements is currently the only way RubyGems supports declaring a dual- or multi-licensed gem.
Note that the array itself does not state how the licenses combine. Include the full text of each license in the gem and describe the exact terms there.
See license= for more discussion
Usage:
Example
spec.licenses = ['MIT', 'GPL-2.0-only']
See also
#licenses
#loaded_from_abi_scoped_spec_dir?
#license=
#missing_extensions?
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0