Project

General

Profile

Feature #7378

Adding Pathname#write

Added by aef (Alexander E. Fischer) over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:49468]

Description

There should be a variant of File.write for Pathname.

I will provide a patch if this is acceptable.

(Please see my other Pathname related tickets too: #7360 #7361 #7362 #7363 )


Files


Subtasks

Feature #6528: Add Pathname#write and Pathname#binwriteClosed06/02/2012akr (Akira Tanaka)Actions

Related issues

Related to Ruby master - Feature #7360: Adding Pathname#globClosedakr (Akira Tanaka)Actions
Related to Ruby master - Feature #7361: Adding Pathname#touchRejectedakr (Akira Tanaka)Actions
Related to Ruby master - Feature #7362: Adding Pathname#start_with?Assignedakr (Akira Tanaka)Actions
Related to Ruby master - Feature #7363: Remove the global Pathname() methodRejected11/15/2012Actions

Updated by Eregon (Benoit Daloze) over 7 years ago

Hello,

Your feature requests sound very logical to me, and I actually made a path manipulation library called "Path" [1]
Notably, #write, #glob and #touch are already implemented as you propose and #start_with? functionality is implemented by #inside?.

I would love to see akr (Akira Tanaka)'s opinion on this and to have a path manipulation class in core with these additions and others which are present in Path and other libraries.

[1] https://github.com/eregon/path

Updated by regularfry (Alex Young) over 7 years ago

On 17/11/12 12:46, Eregon (Benoit Daloze) wrote:

Issue #7378 has been updated by Eregon (Benoit Daloze).

Hello,

Your feature requests sound very logical to me, and I actually made a path manipulation library called "Path" [1]
Notably, #write, #glob and #touch are already implemented as you propose and #start_with? functionality is implemented by #inside?.

I would love to see akr (Akira Tanaka)'s opinion on this and to have a path manipulation class in core with these additions and others which are present in Path and other libraries.

[1] https://github.com/eregon/path

I've written almost exactly this code myself in the past, even down to
the Path constant :-) I'd love to see this promoted to stdlib.

--
Alex

Updated by duerst (Martin Dürst) over 7 years ago

I definitely also have written Pathname#write, and used it. Please provide a patch, that should help getting it included.

Updated by mame (Yusuke Endoh) over 7 years ago

  • Status changed from Open to Assigned
  • Target version set to 2.6
#6

Updated by akr (Akira Tanaka) almost 7 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40107.
Alexander E., thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/pathname/pathname.c (path_write): New method. (path_binwrite): Ditto. [ruby-core:49468] [Feature #7378]

Also available in: Atom PDF