You can do this and change to the directory in one step using the block-form `mkdir`:

```ruby
mkdir 'cvsexample' do
  ...
  system "CVSROOT=${cvsroot}", ...
```