Permalink
Browse files

remove activesupport from runtime dependencies

  • Loading branch information...
1 parent f04686d commit fb6673eb5c442f88b9e7d90525e6eae6e816de96 @shime shime committed Sep 9, 2012
Showing with 54 additions and 2 deletions.
  1. +0 −1 airbrake.gemspec
  2. +1 −1 lib/airbrake.rb
  3. +53 −0 lib/airbrake/utils/blank.rb
View
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
s.test_files = Dir.glob("{test,spec,features}/**/*")
s.add_runtime_dependency("builder")
- s.add_runtime_dependency("activesupport")
s.add_runtime_dependency("girl_friday")
s.add_development_dependency("actionpack", "~> 2.3.8")
View
@@ -2,7 +2,7 @@
require 'net/http'
require 'net/https'
require 'rubygems'
-require 'active_support/core_ext/object/blank'
+require 'airbrake/utils/blank'
require 'airbrake/version'
require 'airbrake/configuration'
require 'airbrake/notice'
@@ -0,0 +1,53 @@
+# stolen from ActiveSupport
+
+class Object
+ def blank?
+ respond_to?(:empty?) ? empty? : !self
+ end
+
+ def present?
+ !blank?
+ end
+
+ def presence
+ self if present?
+ end
+end
+
+class NilClass
+ def blank?
+ true
+ end
+end
+
+class FalseClass
+ def blank?
+ true
+ end
+end
+
+class TrueClass
+ def blank?
+ false
+ end
+end
+
+class Array
+ alias_method :blank?, :empty?
+end
+
+class Hash
+ alias_method :blank?, :empty?
+end
+
+class String
+ def blank?
+ self !~ /[^[:space:]]/
+ end
+end
+
+class Numeric
+ def blank?
+ false
+ end
+end

0 comments on commit fb6673e

Please sign in to comment.