Module: Pebbles::Productivity10x::SwitchHosts::Default

Defined in:
lib/pebbles-productivity10x-switch_hosts.rb

Constant Summary collapse

HOSTS_PATH =
if /windows/i =~ ENV['OS']
  require 'win32/resolv'
  Win32::Resolv.get_hosts_path
else
  require 'resolv'
  Resolv::Hosts::DefaultFileName
end
ORIGINAL_EXTNAME =
'.original'
DENY_EXTNAME =
'.deny'
TEMPLATE =
ERB.new(<<__EOS__)
127.0.0.1       <%= host %> # added by #{File.basename(__FILE__)}
__EOS__
DENY_HOSTS =
%w(
  twitter.com
  api.twitter.com
  facebook.com
  ja-jp.facebook.com
  www.facebook.com
  slashdot.jp
)