Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- CI runs the test suite on Ruby 3.2, 3.3, 3.4, and 4.0.
- Releases are published from GitHub Actions when a `v*` tag on `main` is
pushed, after the CI suite passes.
- The gem package contains only `lib/`, `LICENSE.txt`, `README.md`, and
`CHANGELOG.md`, and building it no longer requires a git checkout.

## [3.5.0] - 2026-07-10

Expand Down
2 changes: 1 addition & 1 deletion drip-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.homepage = "http://github.com/DripEmail/drip-ruby"
spec.license = "MIT"

spec.files = `git ls-files -z`.split("\x0")
spec.files = Dir.glob(["lib/**/*.rb", "LICENSE.txt", "README.md", "CHANGELOG.md"], base: __dir__).sort
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

Expand Down
30 changes: 30 additions & 0 deletions test/gemspec_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

require_relative 'test_helper'
require "open3"
require "rubygems/package"
require "tmpdir"

class Drip::GemspecTest < Drip::TestCase
ROOT = File.expand_path("..", __dir__)

def gem_contents
spec = Gem::Specification.load(File.join(ROOT, "drip-ruby.gemspec"))
Dir.mktmpdir do |dir|
path = File.join(dir, spec.file_name)
Dir.chdir(ROOT) { Gem::Package.build(spec, false, false, path) }
Gem::Package.new(path).contents.sort
end
end

def tracked_lib_files
out, status = Open3.capture2("git", "-C", ROOT, "ls-files", "-z", "lib")
assert status.success?, "git ls-files failed"
out.split("\x0").grep(/\.rb\z/)
end

should "package exactly the tracked lib files and top-level docs" do
expected = (tracked_lib_files + %w[LICENSE.txt README.md CHANGELOG.md]).sort
assert_equal expected, gem_contents
end
end
Loading