Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove activesupport from runtime dependencies

  • Loading branch information...
commit fb6673eb5c442f88b9e7d90525e6eae6e816de96 1 parent f04686d
@shime shime authored
View
1  airbrake.gemspec
@@ -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  lib/airbrake.rb
@@ -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'
View
53 lib/airbrake/utils/blank.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.