unichron 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14cf431be524e94cbee2e7c22ac02a5cf3e4e342e7ad4a697d27f5c0d1dc0a9c
4
- data.tar.gz: 9eabbe15f5790b9e20506dda62f05791d5074e135a3203a49ef78e66e11b136e
3
+ metadata.gz: 3a4f0fbf0b6680f4031ad3ee3d6fd45bc2845abb2ee3dafe5b550fa986c3fcde
4
+ data.tar.gz: 58fcbe515d76ae77bc7bdce931282b44c936753e8473ee11c93db8e1ddd8cd56
5
5
  SHA512:
6
- metadata.gz: 7e2a7c859bd570a082d6fc0d6214ec02c3ade19ff8a2f0f0d66da5327acdfdd7f05bc71a62e4f5e4cf979da052e1e8d83d0b913fd093ef9a1b92c5e91e0f2211
7
- data.tar.gz: 5a201a79de06d56e554e443ba167d36dcd7577c56d69b35b3df1d367e4ac8ff2691e068cca8ef8dc462e5cb08e8b3c192c18ef04ba2fc4abd31586eeb328b7d6
6
+ metadata.gz: d50192c96858d3ca1e3d718220c9c875d48bcda9128d7559bb47267ebca4ae23d6317b2ba1b3fd55d172d33dc154aa51308bdf678ad83be10ca79b0016dda4dd
7
+ data.tar.gz: 4d27149c7cc43fd33558f1f7c99e1babf05e8a060bb08f64bcc92eedf75cf45cd05d7697661ddd733dfd19873037cfdbbdb510b286c9ae282e471b449a2b59e3
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/unichron.rb CHANGED
@@ -15,7 +15,7 @@ class Unichron
15
15
 
16
16
  @mode, @debug = mode, debug
17
17
  @r = select_method(obj)
18
-
18
+
19
19
  end
20
20
 
21
21
  # Returns the elapsed time in a humanized format
@@ -23,29 +23,29 @@ class Unichron
23
23
  # note: An elapsed time more than a day is returned as a calendar date
24
24
  #
25
25
  def elapsed(limit=:day)
26
-
26
+
27
27
  elapsed = Time.now - @r
28
28
 
29
29
  relative_time = if elapsed < Time.now - (Date.today - 1).to_time then
30
30
  Subunit.seconds(elapsed).strfunit("%s")
31
31
  else
32
32
  @r.strftime("%b %d")
33
- end
34
-
33
+ end
34
+
35
35
  end
36
36
 
37
37
  def to_seconds
38
38
  @r
39
39
  end
40
-
40
+
41
41
  def to_date
42
42
  @r.to_date if valid?
43
- end
44
-
43
+ end
44
+
45
45
  def to_datetime
46
46
  @r.to_datetime if valid?
47
- end
48
-
47
+ end
48
+
49
49
  def to_i()
50
50
  @r.to_time.to_i if valid?
51
51
  end
@@ -53,7 +53,7 @@ class Unichron
53
53
  def to_time
54
54
  @r.to_time if valid?
55
55
  end
56
-
56
+
57
57
  def valid?
58
58
  @r.respond_to? :to_time
59
59
  end
@@ -65,16 +65,16 @@ class Unichron
65
65
  if obj.is_a? String then
66
66
 
67
67
  s = obj
68
-
69
- r = if @mode = :little_endian
68
+
69
+ r = if @mode == :little_endian
70
70
  Chronic.parse(s, :endian_precedence => :little)
71
71
  else
72
72
  Chronic.parse(s)
73
73
  end
74
-
75
- puts 'r1: ' + r.inspect if @debug
74
+
75
+ puts 'r1: ' + r.inspect if @debug
76
76
  return r if r
77
-
77
+
78
78
  r = ChronicCron.new s
79
79
  puts 'r2: ' + r.inspect if @debug
80
80
  return r if r.valid?
@@ -82,14 +82,14 @@ class Unichron
82
82
  r = ChronicDuration.parse s
83
83
  puts 'r3: ' + r.inspect if @debug
84
84
  return r if r
85
-
85
+
86
86
  r = ChristianCalendar.new.query(obj)
87
- puts 'r4 ' + r.inspect if @debug
87
+ puts 'r4 ' + r.inspect if @debug
88
88
  return r if r
89
89
 
90
-
90
+
91
91
  return nil
92
-
92
+
93
93
  elsif obj.is_a? Integer
94
94
  r = Time.at obj
95
95
  return r
@@ -101,14 +101,14 @@ class Unichron
101
101
  end
102
102
 
103
103
  module UnichronUtils
104
-
104
+
105
105
  class Quicktime
106
106
 
107
107
  attr_reader :time
108
108
 
109
109
  def initialize(time: Time.now, speed: 4)
110
110
 
111
- @time, @speed = Unichron.new(time).to_time, speed
111
+ @time, @speed = Unichron.new(time).to_time, speed
112
112
 
113
113
  end
114
114
 
@@ -116,9 +116,9 @@ module UnichronUtils
116
116
 
117
117
  @state = :play
118
118
 
119
- Thread.new do
119
+ Thread.new do
120
120
 
121
- loop do
121
+ loop do
122
122
  (sleep 0.5; next) if @state == :pause
123
123
  @time += 1
124
124
  sleep 1.0 / @speed
data.tar.gz.sig CHANGED
Binary file
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.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -11,31 +11,31 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjAxMTA3MDk0MTAxWhcN
15
- MjExMTA3MDk0MTAxWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDnMRY0
17
- Hi9obItHgpFzAQf2rsz0tqYFhU51w4E9u9by0/Ucqgb1ys6pdobX0xuqvwu+zJuo
18
- 42cnAlslGtuV42iwU1xoVgwaOWjo4mm6iLqdqZ6AlLWthNKGR6PVy6kkYKQxDlK8
19
- H4CDDvtZcBVO1mpcqd6PbkoDGGrDswuYz/NNFAXJy+Tdzi8wxUFDMeI60yrqx0lh
20
- DyB0YS+tgOwYmTPqQVSM3ePoEEVK6wlG3k7Tj6XtbgWaDWuua2iXASAV80ArLdR+
21
- cCmTzRa13kAVNmRJB6M9QY0W9WBYGMSM1lNnw1n0SNq5IdHO7JvTdR/W9Y5vadyU
22
- cQX++dOv6jEufPOa/qRKpynmSqPC7pO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p9CNT4qIJddU5yQR4SmdSuj2BcmXwzOPDRYKevD9d/FOS3nK7m5AKAa7oi3F
33
+ Fe9rwQujLgeqlb0y4MKvpEEfOL2hoqz5of1SD3905jOSwkJSsTWg+msra/oG3XAY
34
+ qAm64Dr6+JljBLbacpyRDvpq4LgDip1nhEXvKE8UJv6tAMa9G8t3/u5v39iybYbb
35
+ 9bTYEQg/u8pm6Thzr2BcLoeaJbsCiZ9iKYJeoBCc+XzoscI/nxbbRINqZ6mP/F8e
36
+ /oTvXeSY2LeTbE3FHlvSuPJF
37
37
  -----END CERTIFICATE-----
38
- date: 2021-06-22 00:00:00.000000000 Z
38
+ date: 2022-03-04 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: subunit
@@ -63,20 +63,20 @@ dependencies:
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '0.6'
66
+ version: '0.7'
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 0.6.2
69
+ version: 0.7.1
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0.6'
76
+ version: '0.7'
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 0.6.2
79
+ version: 0.7.1
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: christian_calendar
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.1.2
126
+ rubygems_version: 3.2.22
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: A universal chron tool.
metadata.gz.sig CHANGED
Binary file