ruby/ruby — pull request #600 by GrooveStomp (2014-04-26 23:29:26+00:00)
Title: Follow symlinks with dir dot entries

This issue was originally reported against JRuby here: https://github.com/jruby/jruby/issues/1647

I can reproduce it with MRI 1.9.3-p484 and MRI 2.1.1-p76.

```Ruby
require 'tmpdir'
require 'find'
require 'set'
require 'rspec'

describe 'Dir.entries' do
it 'follows symlinks' do
Dir.mktmpdir('jruby-file-find-test') do |fn|
FileUtils.cd(fn) do
# Create real dir with file.
FileUtils.mkdir_p('dir')
FileUtils.touch('dir/foo.txt')

# Create symlink.
File.symlink('dir', 'dir-link')

# Find files in symlinked dir.
filenames = Set.new
Dir.entries('dir-link/') do |entry|
filenames << entry
end

expected_filenames = Set.new(['dir-link/', 'dir-link/foo.txt'])
filenames.should == expected_filenames
end
end
end
end
```
The above test fails, but should pass.