pinger
Version, currently 1.1.25 versions
github.com/spider-gazelle/pinger
Microlibrary to perform ping requests with Crystal Lang
11 stars
3 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
pinger:
github: spider-gazelle/pinger
version: ~> 1.1.2Then run:
shards installshard.yml
- Crystal
>= 0.36.1- License
- MIT
- Author
- Caspian Baska
Dependencies
Development Dependencies
- ameba*github: crystal-ameba/amebadev
README
pinger
Microlib to generate ICMP ping requests.
Avoids sudo requirement of using raw sockets by shelling out to ping and thus pinger has an implicit dependency of ping.
Installation
-
Add the dependency to your
shard.yml:dependencies: pinger: github: spider-gazelle/pinger -
Run
shards install
Usage
require "pinger"
hostname = "www.duckduckgo.com"
pinger = Pinger.new(hostname, count: 3)
pinger.ping # => true / false
puts {
host: pinger.ip,
pingable: pinger.pingable,
warning: pinger.warning,
exception: pinger.exception
}
Or if you would like an error raised
require "pinger"
hostname = "www.doesnotexist.com"
pinger = Pinger.new(hostname, count: 3)
pinger.ping! # => self / raise pinger.exception
Todo
- [ ] utilise
Crystal::Config.default_targetrather than shelling out to uname
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.1.2- Tagged
- Jul 14, 2021
- Commit
08ebd2a591d3- Crystal
>= 0.36.1- Indexed
- yes
Dependents
Repository
github.com/spider-gazelle/pinger
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 30, 2026
- Synced
- Sep 30, 2026
- Versions
- 5