mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
* ext/pathname/pathname.c (path_s_glob): Pathname.glob translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1428b74ff9
commit
6d9b5fdffc
4 changed files with 43 additions and 9 deletions
|
@ -485,15 +485,6 @@ end
|
|||
|
||||
|
||||
class Pathname # * Dir *
|
||||
# See <tt>Dir.glob</tt>. Returns or yields Pathname objects.
|
||||
def Pathname.glob(*args) # :yield: pathname
|
||||
if block_given?
|
||||
Dir.glob(*args) {|f| yield self.new(f) }
|
||||
else
|
||||
Dir.glob(*args).map {|f| self.new(f) }
|
||||
end
|
||||
end
|
||||
|
||||
# See <tt>Dir.getwd</tt>. Returns the current working directory as a Pathname.
|
||||
def Pathname.getwd() self.new(Dir.getwd) end
|
||||
class << self; alias pwd getwd end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue