use multiline do-end blocks and rearrange definition for clarity
Merge pull request #8839 from mattdbridges/clarify_chdir

Clarify Dir.chdir definition