0.0
No commit activity in last 3 years
No release in over 3 years
This simple gem tries to detect your online status by pinging a few places.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

onlinestatus

This very simple gem tells you your online status based on pinging a few places. It is easily fooled, so don't expect it to be reliable in a hostile environment.

Installation

gem install onlinestatus or add onlinestatus to your Gemfile.

Usage example

#!/usr/bin/ruby
require 'onlinestatus'

puts "online" if OnlineStatus.online?
puts "offline" if OnlineStatus.offline?

The gem includes an executable named onlinestatus. It prints the current detected online status, and returns an appropriate exit code: 0 if it seems that you have an internet connection, 1 otherwise.