fix invalid boolean conversion

```
dir += '/' if not (dir.empty? or dir.end_with? '/')
is not the same as
dir += '/' if not dir.empty? or dir.end_with?('/')
```

530dac22c2c4bf7d3464fe7e0859a667ae3653f2

@clarete