diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:50:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:50:01 +0000 |
commit | 91275eb478ceb58083426099b6da3f4c7e189f19 (patch) | |
tree | 260f7d2fa77408b38c5cea96b320b9b0b6713ff2 /debian/vendor-h2o/deps/mruby-dir/mrblib/dir.rb | |
parent | Merging upstream version 1.9.4. (diff) | |
download | dnsdist-91275eb478ceb58083426099b6da3f4c7e189f19.tar.xz dnsdist-91275eb478ceb58083426099b6da3f4c7e189f19.zip |
Merging debian version 1.9.4-1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/vendor-h2o/deps/mruby-dir/mrblib/dir.rb | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/debian/vendor-h2o/deps/mruby-dir/mrblib/dir.rb b/debian/vendor-h2o/deps/mruby-dir/mrblib/dir.rb deleted file mode 100644 index 065ca1c..0000000 --- a/debian/vendor-h2o/deps/mruby-dir/mrblib/dir.rb +++ /dev/null @@ -1,64 +0,0 @@ -class Dir - def each(&block) - while s = self.read - block.call(s) - end - self - end - - alias pos tell - alias pos= seek - - def self.entries(path) - a = [] - self.open(path) { |d| - while s = d.read - a << s - end - } - a - end - - def self.foreach(path, &block) - if block - self.open(path).each { |f| block.call(f) } - else - self.open(path).each - end - end - - def self.open(path, &block) - if block - d = self.new(path) - begin - block.call(d) - ensure - d.close - end - else - self.new(path) - end - end - - def self.chdir(path, &block) - my = self # workaround for https://github.com/mruby/mruby/issues/1579 - if block - wd = self.getwd - begin - self._chdir(path) - block.call(path) - ensure - my._chdir(wd) - end - else - self._chdir(path) - end - end - - class << self - alias exists? exist? - alias pwd getwd - alias rmdir delete - alias unlink delete - end -end |