Rather than
```ruby
cmd = []
some_enumerator.each do |hook|
  cmd += ["my string with #{hook}"]
end
return cmd.join(' && ')
```
you should do something like
```ruby
link_commands = some_enumerator.map do |hook|
  "my string with #{hook}"
end
link_commands.join(' && ')
```