gorillib 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/gorillib.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gorillib}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Infochimps"]
@@ -8,10 +8,22 @@ class Object
8
8
  #
9
9
  # @return [TrueClass, FalseClass]
10
10
  #
11
- # @api public
12
11
  def blank?
13
12
  nil? || (respond_to?(:empty?) && empty?)
14
13
  end
14
+
15
+ ##
16
+ # Returns true if the object is NOT nil or empty
17
+ #
18
+ # [].present? #=> false
19
+ # [1].present? #=> true
20
+ # [nil].present? #=> true
21
+ #
22
+ # @return [TrueClass, FalseClass]
23
+ #
24
+ def present?
25
+ not blank?
26
+ end
15
27
  end # class Object
16
28
 
17
29
  class Numeric
@@ -24,7 +36,6 @@ class Numeric
24
36
  #
25
37
  # @return [FalseClass]
26
38
  #
27
- # @api public
28
39
  def blank?
29
40
  false
30
41
  end
@@ -38,7 +49,6 @@ class NilClass
38
49
  #
39
50
  # @return [TrueClass]
40
51
  #
41
- # @api public
42
52
  def blank?
43
53
  true
44
54
  end
@@ -52,7 +62,6 @@ class TrueClass
52
62
  #
53
63
  # @return [FalseClass]
54
64
  #
55
- # @api public
56
65
  def blank?
57
66
  false
58
67
  end
@@ -66,7 +75,6 @@ class FalseClass
66
75
  #
67
76
  # @return [TrueClass]
68
77
  #
69
- # @api public
70
78
  def blank?
71
79
  true
72
80
  end
@@ -82,7 +90,6 @@ class String
82
90
  #
83
91
  # @return [TrueClass, FalseClass]
84
92
  #
85
- # @api public
86
93
  def blank?
87
94
  strip.empty?
88
95
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Infochimps