Skip to content

Add Pathname#touch as a facade for FileUtils.touch #72

@Richard-Degenne

Description

@Richard-Degenne

Hello,

I am in the process to refactoring some code by replacing usage of File and FileUtils with Pathnames and I was surprised to discover that Pathname#touch does not exist.

Would a pull request for such a method be considered?

Definition of Done

Simple usecase

path = Pathname.new('file.txt')
path.touch

# Would be strictly equivalent to:
FileUtils.touch('file.txt')

With all the optional arguments

path = Pathname.new('file.txt')
time = Time.now - 3600
path.touch(mtime: time, nocreate: true, noop: true, verbose: true)

# Would be strictly equivalent to:
FileUtils.touch('file.txt', mtime: time, nocreate: true, noop: true, verbose: true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions