Ruby

Ruby

By DeepSource

Deprecated attribute assignment in Gemspec file RB-W1001

Anti-pattern
Autofix

Deprecated attribute attributes should not be set in a gemspec file. Removing deprecated attributes allows the user to receive smaller packed gems.

Bad practice

Gem::Specification.new do |spec|
  spec.name = 'your_cool_gem_name'
  spec.test_files = Dir.glob('test/**/*')
end

Gem::Specification.new do |spec|
  spec.name = 'your_cool_gem_name'
  spec.test_files += Dir.glob('test/**/*')
end

Recommended

Gem::Specification.new do |spec|
  spec.name = 'your_cool_gem_name'
end