toon 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/toon.rb +6 -0
  3. data/toon.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f54590efdfb51223a8d93c3c7e060c7a17fa3825e437771dbf2227dd78b6eab
4
- data.tar.gz: 15697b4e11e26b0c55abada9af9ab4eadca89f1466c55940e92aee2cca1e84e0
3
+ metadata.gz: 0d6cf985e078b219d993e72c6e005e832aa11a8ec36618070cbce6d2b66ced19
4
+ data.tar.gz: d6b70b49aea4aa2b63ccd31140e0631fb1ed811000089eb1263cf7008dd29ad4
5
5
  SHA512:
6
- metadata.gz: c14737eb69fe4ae05b0769b7e4d258af682258cf37013ee46478637f3f798c98e22d2a9656ada4a26d8d541686465bc9a5ed249a3b839f38d5de1d01f66bd968
7
- data.tar.gz: 5762f00e404a5c9a70b7d072eb47b0aaefd06f90ebc1a71c5598bceab7e0e3894c31e3d56b24fc7d8d7ceca2d478414e8019a528f620bc935ce2968bb6cea2b9
6
+ metadata.gz: 43cacbf79727cb022f7d3eb9349f943c04b343990ec1011ae56dfd23b6b092d1a211d27302eb386646caedf72210d8e720180a246f1606e2d54318b0ede473f6
7
+ data.tar.gz: 5deb98da771611c870f48c6510f743b2d7be03203de0fcd5040ad38d3550e9ca78ff3fef305943a56735dce0e4227d2df868743eef0b0deb6584fbf6bee45fe7
@@ -45,6 +45,12 @@ def toon(str, func=nil, *args, **opts, &code)
45
45
  yrs = ref.year - dob.year
46
46
  yrs -= 1 if (ref.month < dob.month) || ((ref.month == dob.month) && (ref.day < dob.day))
47
47
  yrs
48
+
49
+ when 'date_on' then str.to_tz.to_date rescue nil # date object
50
+ when 'time_at' then str.to_tz.getutc rescue nil # time object
51
+ when 'isodate' then str.to_tz. strftime("%F" ) rescue "" # date string
52
+ when 'isotime' then str.to_tz.getutc.strftime("%F %T") rescue "" # time string
53
+
48
54
  when 'date'
49
55
  str.to_tz.strftime("%m/%d/%Y") rescue ""
50
56
  when 'Time'
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "toon"
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary = "A Ruby gem that makes it easy to cleanup and format data"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-02 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem is helpful for ETL or other general data cleaning.
14
14
  email: steve.shreeve@gmail.com