From 481c7f9e0d896d770f63b0440d7a0874fbe3ed1f Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Thu, 11 Nov 2010 08:30:18 +0000 Subject: [PATCH] add dsflushcache for OSX --- lib/noprocast.rb | 2 ++ noprocast.gemspec | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/noprocast.rb b/lib/noprocast.rb index 16ac85f..9345182 100644 --- a/lib/noprocast.rb +++ b/lib/noprocast.rb @@ -25,6 +25,7 @@ class Noprocast File.open("/etc/hosts", 'a') do |file| file << "\n\n# noprocast start\n#{current_hosts.map { |host| "127.0.0.1 #{host}" }.join("\n")}\n# noprocast end" end + system "dscacheutil -flushcache" # only for OSX >= 10.5: flush the DNS cache end def deactivate! @@ -57,6 +58,7 @@ class Noprocast end def edit! + setup_deny_file_if_required! editor = ENV['EDITOR'] || 'vi' system "#{editor} #{deny_file_path}" end diff --git a/noprocast.gemspec b/noprocast.gemspec index 2a7aa86..6588e8d 100644 --- a/noprocast.gemspec +++ b/noprocast.gemspec @@ -5,7 +5,7 @@ Gem::Specification.new do |s| s.name = %q{noprocast} - s.version = "0.1.2" + s.version = "0.1.3" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Rob Watson"]