Skip to content

Add a LICENSE file, and ship it plus README.md in the packaged gem #7

Description

@agrberg

Two related gaps, one of which is more than cosmetic.

There is no LICENSE file in this repository at all. s.licenses = ['MIT'] declares MIT in the gemspec, and rubygems.org surfaces that declaration, but the copyright notice and permission text exist nowhere: not in the repo, not in the package. MIT asks that they accompany all copies of the software. Every sibling gem (array_proc, object_pick, unique_permutation, hash_of) has the file; this one is the exception.

s.files ships only the implementation. s.files lists only lib/string_proc.rb, so README.md never travels with the package either. Verified by building the gem and listing the payload:

$ gem build string_proc.gemspec -o out.gem
$ tar -xOf out.gem data.tar.gz | tar -tzf -
lib/string_proc.rb

Anyone reading the gem offline, through gem contents string_proc or by unpacking it, gets no usage documentation. The README.md is the only place the &'method_1.method_2' chaining shorthand is explained.

Fix is to add the MIT text as LICENSE (copy the one from array_proc and update the year if needed), then:

s.files = ['lib/string_proc.rb', 'LICENSE', 'README.md']

This changes the packaged contents, so it needs a version bump and a release rather than riding along with a repo-only commit.

Tracked across the other gems in agrberg/array_proc#7. hash_of is unaffected: its gemspec builds spec.files from git ls-files and already ships both files.

Found while auditing the gemspecs during the Ruby 4.0.6 and lockfile maintenance pass.


Release checklist

Every item here changes what a user receives, so they should land together in one release rather than spending a version bump on each. Ruby 3.3 goes EOL 2027-03-31, and the floor bump is the natural release to attach the rest to.

  • s.files gains LICENSE and README.md (see above) (the LICENSE file itself was added in 5e5c45d)
  • required_ruby_version to >= 3.4 once 3.3 is EOL
  • Drop '3.3' from the CI test matrix and from the lint job's ruby-version
  • Add s.metadata['homepage_uri'] for consistency; hash_of sets it and the other four do not
  • Version bump, then gem push

Two things explicitly need no action. RuboCop's TargetRubyVersion is now inferred from required_ruby_version (the duplicated setting was removed in 83178b9), so raising the gemspec floor moves the lint target on its own. And changelog_uri is left off deliberately: only hash_of has a CHANGELOG.md, so setting it here would point at a file that does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions