779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
|
# File 'lib/rubyhacks.rb', line 779
def self.recursive_entries(dirct=Dir.pwd, hidden = false, toplevel=true)
found = []
chdir(dirct) do
entries(dirct).each do |file|
next if file =~ /^\./ and not hidden
found.push file
next if [".", ".."].include? file
if FileTest.directory?(file)
more = recursive_entries(File.expand_path(file), hidden, false)
found = found + more
end
end
end
return toplevel ? found.map{|f| dirct + '/' + f} : found.map{|f| File.basename(dirct) + '/' + f}
end
|