buzzcore 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.3.5
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.3.4"
8
+ s.version = "0.3.5"
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{2010-02-15}
12
+ s.date = %q{2010-03-23}
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 = [
@@ -96,6 +96,12 @@ String.class_eval do
96
96
  end
97
97
  self
98
98
  end
99
+
100
+ def to_b(aDefault=false)
101
+ return true if ['1','yes','y','true','on'].include?(self.downcase)
102
+ return false if ['0','no','n','false','off'].include?(self.downcase)
103
+ aDefault
104
+ end
99
105
 
100
106
  # uses
101
107
  #URLIZE_PATTERN = /[ \/\\\(\)\[\]]/
@@ -365,6 +371,10 @@ Fixnum.class_eval do
365
371
  self==0 ? nil : self
366
372
  end
367
373
 
374
+ def to_b(aDefault=false)
375
+ self==0 ? false : true
376
+ end
377
+
368
378
  end
369
379
 
370
380
  Bignum.class_eval do
@@ -372,6 +382,10 @@ Bignum.class_eval do
372
382
  def to_nil
373
383
  self==0 ? nil : self
374
384
  end
385
+
386
+ def to_b(aDefault=false)
387
+ self==0 ? false : true
388
+ end
375
389
 
376
390
  end
377
391
 
@@ -381,6 +395,10 @@ NilClass.class_eval do
381
395
  nil
382
396
  end
383
397
 
398
+ def to_b(aDefault=false)
399
+ false
400
+ end
401
+
384
402
  end
385
403
 
386
404
  TrueClass.class_eval do
@@ -389,6 +407,10 @@ TrueClass.class_eval do
389
407
  self
390
408
  end
391
409
 
410
+ def to_b(aDefault=false)
411
+ self
412
+ end
413
+
392
414
  end
393
415
 
394
416
  FalseClass.class_eval do
@@ -397,6 +419,10 @@ FalseClass.class_eval do
397
419
  nil
398
420
  end
399
421
 
422
+ def to_b(aDefault=false)
423
+ self
424
+ end
425
+
400
426
  end
401
427
 
402
428
 
@@ -52,7 +52,7 @@ module StringUtils
52
52
  def self.split3(aString,aPattern,aOccurence=0)
53
53
  matches = aString.scan_md(aPattern)
54
54
  match = matches[aOccurence]
55
- parts = match ? [match.pre_match,match.to_s,match.post_match] : [aString,nil,'']
55
+ parts = (match ? [match.pre_match,match.to_s,match.post_match] : [aString,nil,''])
56
56
 
57
57
  if !block_given? # return head,match,tail
58
58
  parts
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.3.4
4
+ version: 0.3.5
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: 2010-02-15 00:00:00 +08:00
12
+ date: 2010-03-23 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency