diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0a64758..fe02ffb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -379,14 +379,6 @@ Style/TrailingComma: - 'spec/initializers/action_mailer_spec.rb' - 'spec/initializers/devise_spec.rb' -# Offense count: 9 -# Cop supports --auto-correct. -Style/TrailingWhitespace: - Exclude: - - 'app/models/notification_service.rb' - - 'app/models/notification_services/gtalk_service.rb' - - 'config/initializers/cve-2013-0156.rb' - # Offense count: 2 Style/UnlessElse: Exclude: diff --git a/app/models/notification_service.rb b/app/models/notification_service.rb index 228ab1b..93b92f0 100644 --- a/app/models/notification_service.rb +++ b/app/models/notification_service.rb @@ -18,7 +18,7 @@ class NotificationService validate :check_params if Errbit::Config.per_app_notify_at_notices - Fields = [[:notify_at_notices, + Fields = [[:notify_at_notices, { :placeholder => 'comma separated numbers or simply 0 for every notice', :label => 'notify on errors (0 for all errors)' } diff --git a/app/models/notification_services/gtalk_service.rb b/app/models/notification_services/gtalk_service.rb index bc8619c..9241abd 100644 --- a/app/models/notification_services/gtalk_service.rb +++ b/app/models/notification_services/gtalk_service.rb @@ -28,9 +28,9 @@ class NotificationServices::GtalkService < NotificationService ] def check_params - if Fields.detect { |f| self[f[0]].blank? && self[f[2]].blank? } - errors.add :base, - """You must specify your Username, Password, service, service_url + if Fields.detect { |f| self[f[0]].blank? && self[f[2]].blank? } + errors.add :base, + """You must specify your Username, Password, service, service_url and either rooms or users to send to or both""" end end @@ -58,7 +58,7 @@ class NotificationServices::GtalkService < NotificationService end private - + def send_to_users(client, message) user_id.tr(' ', ",").tr(';', ",").split(",").map(&:strip).reject(&:empty?).each do |user| client.send(Jabber::Message.new(user, message)) @@ -66,9 +66,9 @@ private end def send_to_muc(client, message) - #TODO: set this so that it can send to multiple rooms like users, nb multiple room joins in one send fail randomly so leave as one room for the moment + #TODO: set this so that it can send to multiple rooms like users, nb multiple room joins in one send fail randomly so leave as one room for the moment muc = Jabber::MUC::SimpleMUCClient.new(client) - muc.join(room_id + "/errbit") + muc.join(room_id + "/errbit") muc.send(Jabber::Message.new(room_id, message)) end end diff --git a/config/initializers/cve-2013-0156.rb b/config/initializers/cve-2013-0156.rb index 3af798b..deb5306 100644 --- a/config/initializers/cve-2013-0156.rb +++ b/config/initializers/cve-2013-0156.rb @@ -1,3 +1,3 @@ ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::YAML) -ActiveSupport::XmlMini::PARSING.delete("symbol") -ActiveSupport::XmlMini::PARSING.delete("yaml") +ActiveSupport::XmlMini::PARSING.delete("symbol") +ActiveSupport::XmlMini::PARSING.delete("yaml") -- libgit2 0.21.2