royw-imdb 0.0.21 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/lib/object_extensions.rb +16 -11
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/object_extensions.rb
CHANGED
@@ -1,19 +1,24 @@
|
|
1
1
|
# == Synopsis
|
2
2
|
# add a blank? method to all Objects
|
3
3
|
class Object
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
my_extension("blank?") do
|
5
|
+
# return asserted if object is nil or empty
|
6
|
+
def blank?
|
7
|
+
result = nil?
|
8
|
+
unless result
|
9
|
+
if respond_to? 'empty?'
|
10
|
+
if respond_to? 'strip'
|
11
|
+
result = strip.empty?
|
12
|
+
else
|
13
|
+
if respond_to? 'compact'
|
14
|
+
result = compact.empty?
|
15
|
+
else
|
16
|
+
result = empty?
|
17
|
+
end
|
18
|
+
end
|
14
19
|
end
|
15
20
|
end
|
21
|
+
result
|
16
22
|
end
|
17
|
-
result
|
18
23
|
end
|
19
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: royw-imdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roy Wright
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-17 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|