ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:48625] [ruby-trunk - Feature #10381] [Open] Pathname#mkdir_p, Pathname#makedirs が欲しい
       [not found] <redmine.issue-10381.20141014111104@ruby-lang.org>
@ 2014-10-14 11:11 ` takkanm
  2014-10-14 12:30 ` [ruby-dev:48627] [ruby-trunk - Feature #10381] [Feedback] " akr
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: takkanm @ 2014-10-14 11:11 UTC (permalink / raw
  To: ruby-dev

Issue #10381 has been reported by 三村 益隆.

----------------------------------------
Feature #10381: Pathname#mkdir_p, Pathname#makedirs が欲しい
https://bugs.ruby-lang.org/issues/10381

* Author: 三村 益隆
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
Pathname#mkpath にも FileUtils#mkpath と他の同じ挙動をするメソッド名が欲しいです。

~~~
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 82541e9..40c3ae1 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -564,6 +564,8 @@ class Pathname    # * FileUtils *
     FileUtils.mkpath(@path)
     nil
   end
+  alias :mkdir_p :mkpath
+  alias :makedirs :mkpath
 
   # Recursively deletes a directory, including all directories beneath it.
   #
~~~



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [ruby-dev:48627] [ruby-trunk - Feature #10381] [Feedback] Pathname#mkdir_p, Pathname#makedirs が欲しい
       [not found] <redmine.issue-10381.20141014111104@ruby-lang.org>
  2014-10-14 11:11 ` [ruby-dev:48625] [ruby-trunk - Feature #10381] [Open] Pathname#mkdir_p, Pathname#makedirs が欲しい takkanm
@ 2014-10-14 12:30 ` akr
  2014-10-14 12:31 ` [ruby-dev:48628] [ruby-trunk - Feature #10381] " akr
  2014-10-15  4:27 ` [ruby-dev:48632] " takkanm
  3 siblings, 0 replies; 4+ messages in thread
From: akr @ 2014-10-14 12:30 UTC (permalink / raw
  To: ruby-dev

Issue #10381 has been updated by Akira Tanaka.

Status changed from Open to Feedback

mkdir_p はコマンド名っぽくておすすめしたくないな、と思っています。
makedirs については mkdir と単語の略しかたが違っていて気に入らなかったような気がします。

あと Pathname では基本的には alias でいろいろな名前をつけることはしていないという話もあります。


----------------------------------------
Feature #10381: Pathname#mkdir_p, Pathname#makedirs が欲しい
https://bugs.ruby-lang.org/issues/10381#change-49431

* Author: 三村 益隆
* Status: Feedback
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
Pathname#mkpath にも FileUtils#mkpath と他の同じ挙動をするメソッド名が欲しいです。

~~~
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 82541e9..40c3ae1 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -564,6 +564,8 @@ class Pathname    # * FileUtils *
     FileUtils.mkpath(@path)
     nil
   end
+  alias :mkdir_p :mkpath
+  alias :makedirs :mkpath
 
   # Recursively deletes a directory, including all directories beneath it.
   #
~~~



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [ruby-dev:48628] [ruby-trunk - Feature #10381] Pathname#mkdir_p, Pathname#makedirs が欲しい
       [not found] <redmine.issue-10381.20141014111104@ruby-lang.org>
  2014-10-14 11:11 ` [ruby-dev:48625] [ruby-trunk - Feature #10381] [Open] Pathname#mkdir_p, Pathname#makedirs が欲しい takkanm
  2014-10-14 12:30 ` [ruby-dev:48627] [ruby-trunk - Feature #10381] [Feedback] " akr
@ 2014-10-14 12:31 ` akr
  2014-10-15  4:27 ` [ruby-dev:48632] " takkanm
  3 siblings, 0 replies; 4+ messages in thread
From: akr @ 2014-10-14 12:31 UTC (permalink / raw
  To: ruby-dev

Issue #10381 has been updated by Akira Tanaka.

Assignee set to Akira Tanaka

----------------------------------------
Feature #10381: Pathname#mkdir_p, Pathname#makedirs が欲しい
https://bugs.ruby-lang.org/issues/10381#change-49432

* Author: 三村 益隆
* Status: Feedback
* Priority: Normal
* Assignee: Akira Tanaka
* Category: 
* Target version: 
----------------------------------------
Pathname#mkpath にも FileUtils#mkpath と他の同じ挙動をするメソッド名が欲しいです。

~~~
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 82541e9..40c3ae1 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -564,6 +564,8 @@ class Pathname    # * FileUtils *
     FileUtils.mkpath(@path)
     nil
   end
+  alias :mkdir_p :mkpath
+  alias :makedirs :mkpath
 
   # Recursively deletes a directory, including all directories beneath it.
   #
~~~



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [ruby-dev:48632] [ruby-trunk - Feature #10381] Pathname#mkdir_p, Pathname#makedirs が欲しい
       [not found] <redmine.issue-10381.20141014111104@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2014-10-14 12:31 ` [ruby-dev:48628] [ruby-trunk - Feature #10381] " akr
@ 2014-10-15  4:27 ` takkanm
  3 siblings, 0 replies; 4+ messages in thread
From: takkanm @ 2014-10-15  4:27 UTC (permalink / raw
  To: ruby-dev

Issue #10381 has been updated by 三村 益隆.


> mkdir_p はコマンド名っぽくておすすめしたくないな、と思っています。
FIleUtils では mkdir_p のほうがコマンドの挙動がすぐ連想できるの使っています。
FileUtils からの連想で Pathname に無いというのを気づいたため、Pathname#mkdir_p があると嬉しいと感じています。

FileUtils#mkpath と FileUtils#mkdir_p どちらがよく使われているか気になって、GitHub でコードの検索をしたところ FileUtils#mkdir_p のほうがよく使われているようです。

FileUtils#mkdir_p 369,095 https://github.com/search?l=ruby&q=FileUtils.mkdir_p&ref=searchresults&type=Code&utf8=%E2%9C%93
FileUtils#mkpath 17,014 https://github.com/search?utf8=%E2%9C%93&q=FileUtils.mkpath&type=Code&ref=searchresults




----------------------------------------
Feature #10381: Pathname#mkdir_p, Pathname#makedirs が欲しい
https://bugs.ruby-lang.org/issues/10381#change-49443

* Author: 三村 益隆
* Status: Feedback
* Priority: Normal
* Assignee: Akira Tanaka
* Category: 
* Target version: 
----------------------------------------
Pathname#mkpath にも FileUtils#mkpath と他の同じ挙動をするメソッド名が欲しいです。

~~~
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 82541e9..40c3ae1 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -564,6 +564,8 @@ class Pathname    # * FileUtils *
     FileUtils.mkpath(@path)
     nil
   end
+  alias :mkdir_p :mkpath
+  alias :makedirs :mkpath
 
   # Recursively deletes a directory, including all directories beneath it.
   #
~~~



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-15  4:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-10381.20141014111104@ruby-lang.org>
2014-10-14 11:11 ` [ruby-dev:48625] [ruby-trunk - Feature #10381] [Open] Pathname#mkdir_p, Pathname#makedirs が欲しい takkanm
2014-10-14 12:30 ` [ruby-dev:48627] [ruby-trunk - Feature #10381] [Feedback] " akr
2014-10-14 12:31 ` [ruby-dev:48628] [ruby-trunk - Feature #10381] " akr
2014-10-15  4:27 ` [ruby-dev:48632] " takkanm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).