`Dir.chdir` can accept a block, so instead of `chdir`-ing into a directory, doing things, and `chdir`-ing back down, you can do

```eruby
<% Dir.chdir('lib') do -%>
  <%# do things in libdir %>
<% end -%>

<% Dir.chdir('bin') do -%>
  <%# do things in bindir %>
<% end -%>
```