From 4c642e3dc17f98e5560763f019c3eb18e09e5e8c Mon Sep 17 00:00:00 2001 From: Chris Elsworth Date: Tue, 31 Jan 2017 23:30:40 +0000 Subject: Tweak HipChat colours to be a bit more useful MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > It would be lovely if cleared messages were green > —- Tom Hill --- lib/mauve/notifiers/hipchat.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/mauve/notifiers/hipchat.rb b/lib/mauve/notifiers/hipchat.rb index 7537bc5..b29f450 100644 --- a/lib/mauve/notifiers/hipchat.rb +++ b/lib/mauve/notifiers/hipchat.rb @@ -27,13 +27,13 @@ module Mauve def send_alert(destination, alert, all_alerts, conditions = {}) msg = prepare_message(destination, alert, all_alerts, conditions) - colour = case alert.level - when :urgent - "red" - when :normal - "yellow" + colour = case alert.update_type + when 'cleared' + 'green' + when 'acknowledged' + 'yellow' else - "green" + 'red' end opts = { -- cgit v1.2.1 From a3372ff012444a5c330e0f6865851462bcfcea01 Mon Sep 17 00:00:00 2001 From: telyn Date: Mon, 29 Jan 2018 14:33:09 +0000 Subject: remove all mention of Locale --- lib/mauve/sender.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/mauve/sender.rb b/lib/mauve/sender.rb index 29c085b..7a965ab 100644 --- a/lib/mauve/sender.rb +++ b/lib/mauve/sender.rb @@ -1,11 +1,6 @@ # encoding: UTF-8 require 'ipaddr' require 'socket' -#begin -# require 'locale' -#rescue LoadError - # Do nothing -- these are bonus libraries :) -#end require 'mauve/mauve_resolv' require 'mauve/mauve_time' @@ -152,13 +147,6 @@ module Mauve # `nil` doesn't work. update.replace ||= false - # - # Check the locale charset. This is to maximise the amout of information - # mauve receives, rather than provide proper sanitized data for the server. - # - from_charset = (Locale.current.charset || Locale.charset) if defined?(Locale) - from_charset ||= "UTF-8" - # # # -- cgit v1.2.1 From fa9b1e69d7835bce47990648c6d01fc3f67fcded Mon Sep 17 00:00:00 2001 From: telyn Date: Mon, 29 Jan 2018 15:36:25 +0000 Subject: Add changelog entry & remove locale from gemfile --- Gemfile | 2 +- Gemfile.lock | 22 +++++++++++----------- debian/changelog | 3 +++ debian/control | 2 -- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 8acb3ba..4fc00ac 100644 --- a/Gemfile +++ b/Gemfile @@ -28,9 +28,9 @@ gem "rack-protection", "~> 1.5.2" gem "rack-flash3", "~> 1.0.5" gem "tilt", "~> 1.4.1" gem "sinatra", "~> 1.4.5" -gem "locale", "~> 2.1.0" group :test do + gem "locale", "~> 2.1.0" gem "simplecov", :require => false gem "rack-test", "~> 0.6.3" gem "webmock", "~> 1.19.0" diff --git a/Gemfile.lock b/Gemfile.lock index 716949f..21cdb41 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,14 +2,14 @@ GEM remote: https://rubygems.org/ specs: RedCloth (4.2.9) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) bcrypt (3.1.11) bcrypt-ruby (3.1.5) bcrypt (>= 3.1.3) crack (0.4.3) safe_yaml (~> 1.0.0) - daemons (1.2.4) + daemons (1.2.6) data_objects (0.10.17) addressable (~> 2.1) datamapper (1.2.0) @@ -75,11 +75,11 @@ GEM json_pure (1.8.6) locale (2.1.2) log4r (1.1.10) - mini_portile2 (2.2.0) - multi_json (1.12.1) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) - public_suffix (2.0.5) + mini_portile2 (2.3.0) + multi_json (1.13.1) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + public_suffix (3.0.1) rack (1.5.5) rack-flash3 (1.0.5) rack @@ -92,11 +92,11 @@ GEM safe_yaml (1.0.4) sanitize (2.1.0) nokogiri (>= 1.4.4) - simplecov (0.14.1) + simplecov (0.15.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-html (0.10.1) + simplecov-html (0.10.2) sinatra (1.4.8) rack (~> 1.5) rack-protection (~> 1.4) @@ -148,4 +148,4 @@ DEPENDENCIES webmock (~> 1.19.0) BUNDLED WITH - 1.13.6 + 1.16.0 diff --git a/debian/changelog b/debian/changelog index e4d42d3..b436c88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,9 @@ mauvealert (3.16.0) UNRELEASED; urgency=medium * Make authentication work for AJAX requests (#22, !3) * Change 'Events' nav item to load day list instead of calendar (#18, !3) + [ Telyn Roat] + * Removed need for locale gem outside of tests. (github pr #3) + -- Patrick J Cherry Mon, 01 Aug 2017 14:37:32 +0100 mauvealert (3.15.15-1) stable; urgency=medium diff --git a/debian/control b/debian/control index 5e913b3..41864f8 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,6 @@ Architecture: any Pre-Depends: libjs-jquery Depends: adduser, lsb-base, ruby | ruby-interpreter, ruby-bundler, ${shlibs:Depends}, ${misc:Depends} Suggests: mauvealert-client -Recommends: ruby-locale | liblocale-ruby1.8 Description: Mauve network alert system -- server Mauve is a network alert system for system and network administrators. You can use it to quickly set up ad-hoc monitoring for a variety of services, and to @@ -25,7 +24,6 @@ Description: Mauve network alert system -- server Package: mauvealert-client Architecture: all Depends: ruby | ruby-interpreter, ruby-protobuf, ${misc:Depends} -Recommends: liblocale-ruby1.8 | ruby-locale Replaces: mauvealert-common Conflicts: mauvealert-common Provides: mauvealert-common -- cgit v1.2.1