[DRE-commits] [rerun] 01/02: add patch to support desktop notifications with notify-send

Antonio Terceiro terceiro at moszumanska.debian.org
Thu Feb 23 17:42:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository rerun.

commit 04bf75c947857430ac2f2205652da4e8d2f29419
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Thu Feb 23 14:38:34 2017 -0300

    add patch to support desktop notifications with notify-send
---
 debian/changelog                                   |  6 +++
 ...-to-notifications-on-GNU-Linux-using-noti.patch | 50 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 57 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6b667d2..6aa687d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+rerun (0.11.0-2) UNRELEASED; urgency=medium
+
+  * add patch to support desktop notifications with notify-send
+
+ -- Antonio Terceiro <terceiro at debian.org>  Thu, 23 Feb 2017 14:38:17 -0300
+
 rerun (0.11.0-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/patches/0004-Add-support-to-notifications-on-GNU-Linux-using-noti.patch b/debian/patches/0004-Add-support-to-notifications-on-GNU-Linux-using-noti.patch
new file mode 100644
index 0000000..0bf99c8
--- /dev/null
+++ b/debian/patches/0004-Add-support-to-notifications-on-GNU-Linux-using-noti.patch
@@ -0,0 +1,50 @@
+From: Antonio Terceiro <terceiro at debian.org>
+Date: Thu, 23 Feb 2017 14:37:03 -0300
+Subject: Add support to notifications on GNU/Linux using notify-send
+
+Signed-off-by: Antonio Terceiro <terceiro at debian.org>
+---
+ lib/rerun/notification.rb | 9 +++++++--
+ lib/rerun/options.rb      | 2 +-
+ 2 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/lib/rerun/notification.rb b/lib/rerun/notification.rb
+index 6663d47..49acd75 100644
+--- a/lib/rerun/notification.rb
++++ b/lib/rerun/notification.rb
+@@ -13,8 +13,6 @@ module Rerun
+     end
+ 
+     def command
+-      return unless mac?
+-
+       # todo: strategy or subclass
+ 
+       s = nil
+@@ -34,6 +32,13 @@ module Rerun
+         end
+       end
+ 
++      if s.nil? and options[:notify] == true or options[:notify] == "notify-send"
++        if (cmd = command_named('notify-send'))
++          icon_str = "--icon #{icon}" if icon
++          s = "#{cmd} -t 500 --hint=int:transient:1 #{icon_str} \"#{app_name}: #{title} -- #{body}\""
++        end
++      end
++
+       s
+     end
+ 
+diff --git a/lib/rerun/options.rb b/lib/rerun/options.rb
+index f2e4f39..1e837c7 100644
+--- a/lib/rerun/options.rb
++++ b/lib/rerun/options.rb
+@@ -82,7 +82,7 @@ module Rerun
+           return
+         end
+ 
+-        opts.on("--[no-]notify [notifier]", "send messages through growl (requires growlnotify) or osx (requires terminal-notifier gem)") do |notifier|
++        opts.on("--[no-]notify [notifier]", "send messages through a desktop notification application. Supports growl (requires growlnotify), osx (requires terminal-notifier gem), and notify-send on GNU/Linux (notify-send must be installed)") do |notifier|
+           notifier = true if notifier.nil?
+           options[:notify] = notifier
+         end
diff --git a/debian/patches/series b/debian/patches/series
index ea3aced..1b9f474 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 0001-Read-version-number-from-installed-gemspec.patch
 0002-Turn-README-into-a-manpage.patch
 0003-Fix-Object-timeout-deprecation-warning-in-Ruby-2.3.patch
+0004-Add-support-to-notifications-on-GNU-Linux-using-noti.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/rerun.git



More information about the Pkg-ruby-extras-commits mailing list