Skip to content

Commit

Permalink
Use absolute module namespace to prevent conflict with Guard::Process
Browse files Browse the repository at this point in the history
Guard has it's own Process class and when calling Process.kill will use the Process module/class under Guard which does not implement kill resulting in error like: NoMethodError: undefined method `wait2' for Guard::Process:Class.
  • Loading branch information
cristianbica authored and dblock committed Apr 30, 2019
1 parent 5c52318 commit eb22e84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
2.2.1 (Next)
============

* [#24](https://github.com/dblock/guard-rack/pull/24): Use absolute module namespace to prevent conflict with Guard::Process - [@cristianbica](https://github.com/cristianbica).
* Your contribution here.

2.2.0 (4/16/2016)
=================

* [#23](https://github.com/dblock/guard-rack/pull/23) Added Windows support - [@jonyeezs](https://github.com/jonyeezs).
* [#23](https://github.com/dblock/guard-rack/pull/23): Added Windows support - [@jonyeezs](https://github.com/jonyeezs).

2.1.1 (03/07/2015)
============
Expand Down
6 changes: 3 additions & 3 deletions lib/guard/rack/custom_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def kill(pid, force = false)
result = -1
UI.debug("Trying to kill Rack (PID #{pid})...")
unless force
Process.kill('INT', pid)
::Process.kill('INT', pid)
begin
Timeout.timeout(options[:timeout]) do
_, status = Process.wait2(pid)
_, status = ::Process.wait2(pid)
result = status.exitstatus
UI.debug("Killed Rack (Exit status: #{result})")
end
Expand All @@ -36,7 +36,7 @@ def kill(pid, force = false)
force = true
end
end
Process.kill('TERM', pid) if force
::Process.kill('TERM', pid) if force
result
end
end
Expand Down

0 comments on commit eb22e84

Please sign in to comment.