You can replace this `each` block, plus the `rules` on line 22, with just this:

```ruby
rules.map do |rule|
  # Note lack of exclamation point after gsub
  rule.gsub(/^(\s)|(\s)$/, "")
end
```