hometime 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hometime.rb +16 -14
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae6b0265c1dc2c49ca4f02adf98b55967ca45cb0c8f8ede0030f7178ebb53c4b
|
|
4
|
+
data.tar.gz: d1b471286bdbeca9d25b6e8ab5309039552b77a7f39338abae87c510b51201f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 40b028f3a0c83cd5afdb555460dbf5033c2f9913d9d4cbec6e089c4244cefb9348d1f68443b9806d2c23bec1def151ec3db7075c6d5cd850a7a359f884d535bd
|
|
7
|
+
data.tar.gz: 9eec38137e838f1df585bc950a31e223e4c6e06b967daa392ee4eeb2d4d71930ffc4e93902709d464bec59cf17c4d746e7773d9273d7c661b56ab6d33015d94d
|
data/lib/hometime.rb
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
class Hometime
|
|
2
|
-
def self.initialize(duration)
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@time = gets.chomp
|
|
2
|
+
def self.initialize(duration, start_time)
|
|
3
|
+
@time = start_time
|
|
6
4
|
@duration = duration
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
{
|
|
7
|
+
'leave_time': leave_time.strftime('%H:%M'),
|
|
8
|
+
'hours_remaining': unit_formatted('hour', hours),
|
|
9
|
+
'minutes_remaining': unit_formatted('minute', minutes),
|
|
10
|
+
'seconds_remaining': unit_formatted('second', seconds)
|
|
11
|
+
}
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
private
|
|
@@ -61,17 +61,19 @@ class Hometime
|
|
|
61
61
|
leave_time - current_time
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
#
|
|
65
|
-
def self.
|
|
66
|
-
|
|
64
|
+
# TODO - Read important date from file
|
|
65
|
+
def self.important_dates
|
|
66
|
+
file = File.read('../data/dates.json')
|
|
67
|
+
|
|
68
|
+
puts "#{days_until_important_date_date} days until Christmas!" if days_until_important_date_date > 0
|
|
67
69
|
end
|
|
68
70
|
|
|
69
|
-
def self.
|
|
71
|
+
def self.important_date_date
|
|
70
72
|
this_year = Time.now.strftime('%Y').to_i
|
|
71
73
|
Time.new(this_year, 12, 25)
|
|
72
74
|
end
|
|
73
75
|
|
|
74
|
-
def self.
|
|
75
|
-
((((
|
|
76
|
+
def self.days_until_important_date_date
|
|
77
|
+
((((important_date_date - current_time) / 60) / 60) / 24).ceil
|
|
76
78
|
end
|
|
77
79
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hometime
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Hodgson
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-08-
|
|
11
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A gem to calculate when your shift ends
|
|
14
14
|
email: james.hodgson@sage.com
|
|
@@ -21,7 +21,7 @@ homepage: https://rubygems.org/gems/hometime_jameshodgson
|
|
|
21
21
|
licenses:
|
|
22
22
|
- MIT
|
|
23
23
|
metadata: {}
|
|
24
|
-
post_install_message:
|
|
24
|
+
post_install_message:
|
|
25
25
|
rdoc_options: []
|
|
26
26
|
require_paths:
|
|
27
27
|
- lib
|
|
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
37
37
|
version: '0'
|
|
38
38
|
requirements: []
|
|
39
39
|
rubygems_version: 3.0.3
|
|
40
|
-
signing_key:
|
|
40
|
+
signing_key:
|
|
41
41
|
specification_version: 4
|
|
42
42
|
summary: Home Time
|
|
43
43
|
test_files: []
|