You could do something like this instead here.

```ruby
@cookbook_versions.map { |v| "<li>#{v.version}</li>" }.to_sentence(last_word_connector: ', ')
```

Accomplishes the same thing without branching.