From 2955aa731354d43c84d0640ab3d08be256979ad0 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Thu, 9 May 2024 12:01:03 -0400 Subject: [PATCH] Modernize gemspec & remove unnecessary files to reduce size --- rails-footnotes.gemspec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rails-footnotes.gemspec b/rails-footnotes.gemspec index 69b17d1..47a88d0 100644 --- a/rails-footnotes.gemspec +++ b/rails-footnotes.gemspec @@ -3,7 +3,6 @@ require_relative "./lib/rails-footnotes/version" Gem::Specification.new do |s| s.name = "rails-footnotes" s.version = Footnotes::VERSION - s.platform = Gem::Platform::RUBY s.authors = ["Roman V. Babenko", "José Valim", "Keenan Brock", "Duane Johnson", "Adrien Siami", "André Arko"] s.email = ["andre@arko.net"] s.homepage = "http://github.com/indirect/rails-footnotes" @@ -13,7 +12,13 @@ Gem::Specification.new do |s| s.add_dependency "rails", "~> 7.0" s.required_ruby_version = ">= 3.0" - s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + s.files = + IO.popen(["git", "-C", __dir__, "ls-files", "-z", "--", "exe/", "lib/", "*.md", "*.txt", "CHANGELOG", "*LICENSE"], &:read).split("\x0") + .reject do |f| + (File.expand_path(f) == __FILE__) || + f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile Rakefile tasks/]) + end s.require_paths = ["lib"] end