Feature #7378

Adding Pathname#write

Added by Alexander E. Fischer over 1 year ago. Updated about 1 year ago.

[ruby-core:49468]
Status:Closed
Priority:Normal
Assignee:Akira Tanaka
Category:lib
Target version:next minor

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 )

0001-ext-pathname-lib-pathname.rb-add-Pathname-write-and-.patch Magnifier (2.17 KB) Benoit Daloze, 01/14/2013 06:01 AM


Subtasks

Feature #6528: Add Pathname#write and Pathname#binwriteClosedAkira Tanaka


Related issues

Related to ruby-trunk - Feature #7360: Adding Pathname#glob Assigned 11/15/2012
Related to ruby-trunk - Feature #7361: Adding Pathname#touch Assigned 11/15/2012
Related to ruby-trunk - Feature #7362: Adding Pathname#start_with? Assigned 11/15/2012
Related to ruby-trunk - Feature #7363: Remove the global Pathname() method Rejected 11/15/2012

Associated revisions

Revision 40107
Added by Akira Tanaka about 1 year ago

  • ext/pathname/pathname.c (pathwrite): New method. (pathbinwrite): Ditto. [Feature #7378]

History

#1 Updated by Benoit Daloze over 1 year 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'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

#2 Updated by Alex Young over 1 year 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'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

#3 Updated by Martin Dürst over 1 year ago

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

#4 Updated by Yusuke Endoh over 1 year ago

  • Status changed from Open to Assigned
  • Target version set to next minor

#6 Updated by Akira Tanaka about 1 year 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 (pathwrite): New method. (pathbinwrite): Ditto. [Feature #7378]

Also available in: Atom PDF