ruby / ruby/pathname

A means to add an extension

Open
#46 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
32
Forks
24
Avg merge
13h 2m
Merged PRs (30d)
1

Description

I often need to add an extension (be it .tmp or .bak for example).

Writing path.sub_ext("#{path.extname}.tmp") is weird. Likewise for path.sub(/\z/, '.tmp'). And unfortunately + and / have exactly the same semantics, so I can't use that either.

I wish I had add_ext.

Cheers!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review Pathname's existing sub_ext and extname behavior first, using the examples in the issue as the starting cases. Define how add_ext should handle extensions such as .tmp and .bak, then verify that the new method produces the requested paths without changing existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.