leam hall
2018-07-30 11:46:56 UTC
Trying to figure out why this doesn't put just the directory names.
There are directories in options[:source] and if I start an irb
session in that directory, pick a directory name like "docs", and do:
File.directory?('docs')
it returns true.
Besides a brain, a clue. and a life, what am I missing?
Thanks!
Leam
###
Dir.entries(options[:source]).each {|node|
if File.directory?(node)
puts " node is: #{node}."
end
}
# output, even though there are directories present:
node is: ..
node is: ...
# If I remove the "File.directory?() it puts all the files and directories.
Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
There are directories in options[:source] and if I start an irb
session in that directory, pick a directory name like "docs", and do:
File.directory?('docs')
it returns true.
Besides a brain, a clue. and a life, what am I missing?
Thanks!
Leam
###
Dir.entries(options[:source]).each {|node|
if File.directory?(node)
puts " node is: #{node}."
end
}
# output, even though there are directories present:
node is: ..
node is: ...
# If I remove the "File.directory?() it puts all the files and directories.
Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>