unichron 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/unichron.rb +10 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92d9f5b6d666c90d4d0dd7d125c566e1aa67ed9826c0aad0c66b94defa4743be
|
4
|
+
data.tar.gz: 10148902608b462f4b2fea1e92159423c77f586221d56a8f000e4ef59c28b28f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87f868fc76cc9c04ce102a8211acd7d94b6217b65bce609d1bf81425b98c57417ad2bd75e4e855396f262cc5a1677554cfa114de3cce82c9c2b77181a393af62
|
7
|
+
data.tar.gz: 78890badf917a60820e784a6ac78e7dbb22b599d11380b631f172d78bc4ca6455672cf350346dbac1c186ec26caf8b136f1224e5405de1743b5331396015a362
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/unichron.rb
CHANGED
@@ -11,9 +11,9 @@ class Unichron
|
|
11
11
|
|
12
12
|
attr_reader :r
|
13
13
|
|
14
|
-
def initialize(obj, debug: false)
|
14
|
+
def initialize(obj, mode=nil, debug: false)
|
15
15
|
|
16
|
-
@debug = debug
|
16
|
+
@mode, @debug = mode, debug
|
17
17
|
@r = select_method(obj)
|
18
18
|
|
19
19
|
end
|
@@ -22,7 +22,7 @@ class Unichron
|
|
22
22
|
# e.g. elapsed(Time.now - 4000) #=> 1h
|
23
23
|
# note: An elapsed time more than a day is returned as a calendar date
|
24
24
|
#
|
25
|
-
def elapsed()
|
25
|
+
def elapsed(limit=:day)
|
26
26
|
|
27
27
|
elapsed = Time.now - @r
|
28
28
|
|
@@ -57,7 +57,13 @@ class Unichron
|
|
57
57
|
if obj.is_a? String then
|
58
58
|
|
59
59
|
s = obj
|
60
|
-
|
60
|
+
|
61
|
+
r = if @mode = :little_endian
|
62
|
+
Chronic.parse(s, :endian_precedence => :little)
|
63
|
+
else
|
64
|
+
Chronic.parse(s)
|
65
|
+
end
|
66
|
+
|
61
67
|
puts 'r1: ' + r.inspect if @debug
|
62
68
|
return r if r
|
63
69
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unichron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
vPngqdMCuVEkZm+YuLTXph0I590TF5EmMRQMILYYtjV6ClWHIEa5WlToyO2Fk1OL
|
36
36
|
aagRjWlkRSoGiE7602v0Wo/u
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2021-
|
38
|
+
date: 2021-05-01 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: subunit
|
metadata.gz.sig
CHANGED
Binary file
|