buzzcore 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/buzzcore.gemspec +2 -2
- data/lib/buzzcore/extend_base_classes.rb +55 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.7
|
data/buzzcore.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{buzzcore}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["buzzware"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-01-14}
|
13
13
|
s.description = %q{buzzcore is the ruby core library developed and used by Buzzware Solutions.}
|
14
14
|
s.email = %q{contact@buzzware.com.au}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -87,6 +87,10 @@ String.class_eval do
|
|
87
87
|
self.scan(aPattern) {|s| result << $~ }
|
88
88
|
result
|
89
89
|
end
|
90
|
+
|
91
|
+
def to_nil
|
92
|
+
self.empty? ? nil : self
|
93
|
+
end
|
90
94
|
|
91
95
|
end
|
92
96
|
|
@@ -240,6 +244,10 @@ module HashUtils
|
|
240
244
|
return result
|
241
245
|
end
|
242
246
|
|
247
|
+
def to_nil
|
248
|
+
self.empty? ? nil : self
|
249
|
+
end
|
250
|
+
|
243
251
|
end
|
244
252
|
|
245
253
|
Hash.class_eval do
|
@@ -286,6 +294,11 @@ module ArrayUtils
|
|
286
294
|
aArray ||= self
|
287
295
|
filter_exclude!(aValues,aArray.clone)
|
288
296
|
end
|
297
|
+
|
298
|
+
def to_nil
|
299
|
+
self.empty? ? nil : self
|
300
|
+
end
|
301
|
+
|
289
302
|
end
|
290
303
|
|
291
304
|
Array.class_eval do
|
@@ -326,3 +339,45 @@ if defined? ActiveRecord
|
|
326
339
|
|
327
340
|
end
|
328
341
|
end
|
342
|
+
|
343
|
+
Fixnum.class_eval do
|
344
|
+
|
345
|
+
def to_nil
|
346
|
+
self==0 ? nil : self
|
347
|
+
end
|
348
|
+
|
349
|
+
end
|
350
|
+
|
351
|
+
Bignum.class_eval do
|
352
|
+
|
353
|
+
def to_nil
|
354
|
+
self==0 ? nil : self
|
355
|
+
end
|
356
|
+
|
357
|
+
end
|
358
|
+
|
359
|
+
NilClass.class_eval do
|
360
|
+
|
361
|
+
def to_nil
|
362
|
+
nil
|
363
|
+
end
|
364
|
+
|
365
|
+
end
|
366
|
+
|
367
|
+
TrueClass.class_eval do
|
368
|
+
|
369
|
+
def to_nil
|
370
|
+
self
|
371
|
+
end
|
372
|
+
|
373
|
+
end
|
374
|
+
|
375
|
+
FalseClass.class_eval do
|
376
|
+
|
377
|
+
def to_nil
|
378
|
+
nil
|
379
|
+
end
|
380
|
+
|
381
|
+
end
|
382
|
+
|
383
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buzzcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- buzzware
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-14 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|