Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::Specification#files
files
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/specification.rb, line 250
def files
# DO NOT CHANGE TO ||= ! This is not a normal accessor. (yes, it sucks)
# DOC: Why isn't it normal? Why does it suck? How can we fix this?
@files = [@files,
@test_files,
add_bindir(@executables),
@extra_rdoc_files,
@extensions].flatten.compact.uniq.sort
end
Files included in this gem. You cannot append to this accessor, you must assign to it.
Only add files you can require to this list, not directories, etc.
Directories are automatically stripped from this list when building a gem, other non-files cause an error.
Usage:
Example
require 'rake' spec.files = FileList['lib/**/*.rb', 'bin/*', '[A-Z]*'].to_a # or without Rake... spec.files = Dir['lib/**/*.rb'] + Dir['bin/*'] spec.files += Dir['[A-Z]*'] spec.files.reject! { |fn| fn.include? "CVS" }
See also
#files=
#file_name
#extra_rdoc_files=
#find_all_satisfiers
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0