toon 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toon.rb +6 -0
- data/toon.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d6cf985e078b219d993e72c6e005e832aa11a8ec36618070cbce6d2b66ced19
|
4
|
+
data.tar.gz: d6b70b49aea4aa2b63ccd31140e0631fb1ed811000089eb1263cf7008dd29ad4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43cacbf79727cb022f7d3eb9349f943c04b343990ec1011ae56dfd23b6b092d1a211d27302eb386646caedf72210d8e720180a246f1606e2d54318b0ede473f6
|
7
|
+
data.tar.gz: 5deb98da771611c870f48c6510f743b2d7be03203de0fcd5040ad38d3550e9ca78ff3fef305943a56735dce0e4227d2df868743eef0b0deb6584fbf6bee45fe7
|
data/lib/toon.rb
CHANGED
@@ -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'
|
data/toon.gemspec
CHANGED
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.
|
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-
|
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
|