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,13 +33,6 @@ Metrics/MethodLength: | ||
33 | Metrics/PerceivedComplexity: | 33 | Metrics/PerceivedComplexity: |
34 | Max: 12 | 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 | # Offense count: 4 | 36 | # Offense count: 4 |
44 | # Cop supports --auto-correct. | 37 | # Cop supports --auto-correct. |
45 | # Configuration parameters: Include. | 38 | # Configuration parameters: Include. |
app/models/notification_services/gtalk_service.rb
@@ -60,7 +60,7 @@ class NotificationServices::GtalkService < NotificationService | @@ -60,7 +60,7 @@ class NotificationServices::GtalkService < NotificationService | ||
60 | private | 60 | private |
61 | 61 | ||
62 | def send_to_users client, message | 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 | client.send(Jabber::Message.new(user, message)) | 64 | client.send(Jabber::Message.new(user, message)) |
65 | end | 65 | end |
66 | end | 66 | end |
lib/hoptoad/v2.rb