Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't overwrite existing blank? implementation

  • Loading branch information...
commit a562bdf906f6b1c300761102cb77240c138013ae 1 parent 78411f2
Nilesh Trivedi authored
Showing with 6 additions and 10 deletions.
  1. +6 −10 lib/gupshup.rb
16 lib/gupshup.rb
View
@@ -7,19 +7,15 @@
require 'httpclient'
class NilClass
- unless defined? :blank?
- def blank?
- true
- end
- end
+ def blank?
+ true
+ end unless nil.respond_to? :blank?
end
class String
- unless defined? :blank?
- def blank?
- self.empty?
- end
- end
+ def blank?
+ self !~ /\S/
+ end unless "".respond_to? :blank?
end
module Gupshup
Please sign in to comment.
Something went wrong with that request. Please try again.