Project

blockhosts

0.0
No commit activity in last 3 years
No release in over 3 years
Conveniently enables or disables the blocking of hostnames in the /etc/hosts file e.g. 127.0.0.1 facebook.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.9.1, ~> 0.9
>= 0.3.7, ~> 0.3
 Project Readme

Blocking Facebook from your machine using the blockhosts gem

require 'blockhosts'

# add the facebook domains to /etc/hosts
Host.add 'facebook', 'http://a0.jamesrobertson.eu/r/txt/2018/oct/21/' + 
                      'facebook-list-of-urls-to-block.txt'

# Enforce the blocking of Facebook domains in /etc/hosts
Host.block 'facebook' 

#Host.unblock 'facebook' # comments out the facebook entries in /etc/hosts
#Host.rm 'facebook' # removes the facebook entries from /etc/hosts

blockhosts facebook hosts block gem