Permalink
Browse files

net-ping and mail are no longer runtime dependencies if not used

  • Loading branch information...
1 parent 7d7cb39 commit 8d821936cc452cadb9974461533f080d56afc37a @vinibaggio vinibaggio committed Feb 3, 2011
Showing with 16 additions and 8 deletions.
  1. +3 −4 Gemfile
  2. +6 −1 lib/outpost/notifiers/email.rb
  3. +7 −1 lib/outpost/scouts/ping.rb
  4. +0 −2 outpost.gemspec
View
7 Gemfile
@@ -1,10 +1,9 @@
source :rubygems
-gem 'net-ping', :require => false
-gem 'mail', :require => false
-
-
group :test do
+ gem 'mail', :require => false
+ gem 'net-ping', :require => false
+
gem 'thin'
gem 'rack'
gem 'sinatra'
View
7 lib/outpost/notifiers/email.rb
@@ -1,4 +1,9 @@
-require 'mail'
+begin
+ require 'mail'
+rescue LoadError => e
+ puts "Please install mail gem: gem install mail"
+ raise
+end
module Outpost
module Notifiers
View
8 lib/outpost/scouts/ping.rb
@@ -1,4 +1,10 @@
-require 'net/ping/external'
+begin
+ require 'net/ping/external'
+rescue LoadError => e
+ puts "Please install net-ping gem: gem install net-ping".
+ raise
+end
+
require 'outpost/expectations'
module Outpost
View
2 outpost.gemspec
@@ -16,6 +16,4 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
-
- s.add_dependency("net-ping", "~> 1.3.7")
end

0 comments on commit 8d82193

Please sign in to comment.