Also will the current code call stat twice? Should it maybe be:

```
resource_stat = @resource.stat
is_a_directory = (resource_stat && resource_stat.directory?)
```