[DRE-commits] [rerun] 09/12: remove usage of deprecated feature in Ruby 2.3
Antonio Terceiro
terceiro at moszumanska.debian.org
Mon May 9 01:18:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository rerun.
commit c3d3adcf11f753e43d19b889ca518208e9f41410
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date: Sun May 8 21:49:38 2016 -0300
remove usage of deprecated feature in Ruby 2.3
---
debian/changelog | 2 +
...ls-to-Object.timeout-with-calls-to-Timeou.patch | 66 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 69 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 24c9ca5..2e604cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ rerun (0.11.0-1) UNRELEASED; urgency=medium
* Stop building manpages with ruby-ronn which depends on a deprecated
library.
* Build manpage with asciidoctor, straight from the upstream README.md
+ * 0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch: remove
+ usage of deprecated feature in Ruby 2.3
-- Antonio Terceiro <terceiro at debian.org> Wed, 16 Mar 2016 17:14:58 -0300
diff --git a/debian/patches/0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch b/debian/patches/0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch
new file mode 100644
index 0000000..e3da2d7
--- /dev/null
+++ b/debian/patches/0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch
@@ -0,0 +1,66 @@
+From: Antonio Terceiro <terceiro at softwarelivre.org>
+Date: Sun, 8 May 2016 21:48:19 -0300
+Subject: Replace calls to Object.timeout with calls to Timeout.timeout
+
+The former is deprecated on Ruby 2.3
+---
+ lib/rerun/runner.rb | 4 ++--
+ spec/functional_spec.rb | 2 +-
+ spec/inc_process.rb | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/lib/rerun/runner.rb b/lib/rerun/runner.rb
+index b085ff1..58511a7 100644
+--- a/lib/rerun/runner.rb
++++ b/lib/rerun/runner.rb
+@@ -251,13 +251,13 @@ module Rerun
+ if @pid && (@pid != 0)
+ notify "stopping", "All good things must come to an end." unless @restarting
+ begin
+- timeout(5) do # todo: escalation timeout setting
++ Timeout.timeout(5) do # todo: escalation timeout setting
+ # start with a polite SIGTERM
+ signal(default_signal) && Process.wait(@pid)
+ end
+ rescue Timeout::Error
+ begin
+- timeout(5) do
++ Timeout.timeout(5) do
+ # escalate to SIGINT aka control-C since some foolish process may be ignoring SIGTERM
+ signal("INT") && Process.wait(@pid)
+ end
+diff --git a/spec/functional_spec.rb b/spec/functional_spec.rb
+index a2b8d61..1ad4a92 100644
+--- a/spec/functional_spec.rb
++++ b/spec/functional_spec.rb
+@@ -84,7 +84,7 @@ describe "the rerun command" do
+ pid = @inc.inc_parent_pid
+ # puts "test sending INT to #{pid}"
+ Process.kill("INT", pid)
+- timeout(6) {
++ Timeout.timeout(6) {
+ # puts "test waiting for #{pid}"
+ Process.wait(@inc.rerun_pid) rescue Errno::ESRCH
+ }
+diff --git a/spec/inc_process.rb b/spec/inc_process.rb
+index 0d3fbc9..2b19a84 100644
+--- a/spec/inc_process.rb
++++ b/spec/inc_process.rb
+@@ -25,7 +25,7 @@ class IncProcess
+ def kill
+ begin
+ pids = ([@inc_pid, @inc_parent_pid, @rerun_pid] - [Process.pid]).uniq
+- timeout(5) do
++ Timeout.timeout(5) do
+ pids.each do |pid|
+ # puts "sending INT to #{pid}"
+ Process.kill("INT", pid) rescue Errno::ESRCH
+@@ -51,7 +51,7 @@ class IncProcess
+
+ def launch
+ @rerun_pid = spawn(rerun_cmd)
+- timeout(10) { sleep 0.5 until File.exist?(@inc_output_file) }
++ Timeout.timeout(10) { sleep 0.5 until File.exist?(@inc_output_file) }
+ sleep 3 # let rerun's watcher get going
+ read
+ end
diff --git a/debian/patches/series b/debian/patches/series
index f640368..a16ea38 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
0001-Read-version-number-from-installed-gemspec.patch
0002-Turn-README-into-a-manpage.patch
+0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.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