From 316906cbbb529839c2ffa3f37a010193f7722352 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 30 Mar 2008 05:05:19 +0000 Subject: Merge in latest tmail trunk r241 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../vendor/tmail-1.2.2/tmail/core_extensions.rb | 32 ++++++++++------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'actionmailer/lib/action_mailer/vendor/tmail-1.2.2/tmail/core_extensions.rb') diff --git a/actionmailer/lib/action_mailer/vendor/tmail-1.2.2/tmail/core_extensions.rb b/actionmailer/lib/action_mailer/vendor/tmail-1.2.2/tmail/core_extensions.rb index cc24e97778..da62c33bbf 100644 --- a/actionmailer/lib/action_mailer/vendor/tmail-1.2.2/tmail/core_extensions.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail-1.2.2/tmail/core_extensions.rb @@ -1,14 +1,9 @@ -=begin rdoc - -= Ruby on Rails Core Extensions - -provides .blank? - -=end -unless Object.respond_to?(:blank?) #:nodoc: - # Check first to see if we are in a Rails environment, no need to - # define these methods if we are +#:stopdoc: +unless Object.respond_to?(:blank?) class Object + # Check first to see if we are in a Rails environment, no need to + # define these methods if we are + # An object is blank if it's nil, empty, or a whitespace string. # For example, "", " ", nil, [], and {} are blank. # @@ -27,41 +22,42 @@ unless Object.respond_to?(:blank?) #:nodoc: end end - class NilClass #:nodoc: + class NilClass def blank? true end end - class FalseClass #:nodoc: + class FalseClass def blank? true end end - class TrueClass #:nodoc: + class TrueClass def blank? false end end - class Array #:nodoc: + class Array alias_method :blank?, :empty? end - class Hash #:nodoc: + class Hash alias_method :blank?, :empty? end - class String #:nodoc: + class String def blank? empty? || strip.empty? end end - class Numeric #:nodoc: + class Numeric def blank? false end end -end \ No newline at end of file +end +#:startdoc: \ No newline at end of file -- cgit v1.2.3