Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Terminate process listening on a port
Ruby
branch: master

Merge branch 'release/0.0.2'

latest commit fa1f88d967
Kris Leech authored
Failed to load latest commit information.
lib Bump version to 0.0.2
spec fix specs, they do not seem to run without these options commented out
.gitignore bare gem with README
.rspec Add Rspec
Gemfile
LICENSE.txt bare gem with README
README.md
Rakefile bare gem with README
TODO
harbour.gemspec Note about current OS support and link to homepage

README.md

Harbour

With harbour you can:

  • See if a port is open
  • Find the pid of the process listening on a port
  • Kill the process listening on a port

Note: Only works on MacOS, GNU/Linux coming soon...

Installation

Add this line to your application's Gemfile:

gem 'harbour'

Usage

port = Harbour::Port.new(8080)
port.open? # => true
port.pid   # => 1282
port.term!
port.kill!

Terminating a process

port = Harbour::Port.new(8080)
port.term!(:timeout => 10, :try_kill => true)
  • timeout - the number of seconds to wait for the process to terminate before raising an exception
  • try_kill - if a TERM signal fails before timeout then send a KILL signal

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

Kris Leech / teamcoding.com

Something went wrong with that request. Please try again.