Class: Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/Helper.rb

Instance Method Summary collapse

Instance Method Details

#recursive_each(&block) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/Helper.rb', line 70

def recursive_each &block
  self.each do |dir|
    dirpath = self.path + '/' + dir
    if File.directory?(dirpath) then
      if dir != '.' && dir != '..' then
        Dir.new(dirpath).recursive_each &block
      end
    else
      block.call dirpath
    end
  end
end