Commit b76bf20a49b6a208337ff1464b627195807071ce
1 parent
c30adbfc
Exists in
master
and in
1 other branch
Rubocop: perfer .tr over .gsub when just replacing chars
Showing
3 changed files
with
2 additions
and
9 deletions
Show diff stats
.rubocop_todo.yml
... | ... | @@ -33,13 +33,6 @@ Metrics/MethodLength: |
33 | 33 | Metrics/PerceivedComplexity: |
34 | 34 | Max: 12 |
35 | 35 | |
36 | -# Offense count: 2 | |
37 | -# Cop supports --auto-correct. | |
38 | -Performance/StringReplacement: | |
39 | - Exclude: | |
40 | - - 'app/models/notification_services/gtalk_service.rb' | |
41 | - - 'lib/hoptoad/v2.rb' | |
42 | - | |
43 | 36 | # Offense count: 4 |
44 | 37 | # Cop supports --auto-correct. |
45 | 38 | # Configuration parameters: Include. | ... | ... |
app/models/notification_services/gtalk_service.rb
... | ... | @@ -60,7 +60,7 @@ class NotificationServices::GtalkService < NotificationService |
60 | 60 | private |
61 | 61 | |
62 | 62 | def send_to_users client, message |
63 | - user_id.gsub(/ /i, ",").gsub(/;/i, ",").split(",").map(&:strip).reject(&:empty?).each do |user| | |
63 | + user_id.tr(' ', ",").tr(';', ",").split(",").map(&:strip).reject(&:empty?).each do |user| | |
64 | 64 | client.send(Jabber::Message.new(user, message)) |
65 | 65 | end |
66 | 66 | end | ... | ... |