txt_timesheet 1.1.4 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/timesheet +2 -2
- data/lib/txt_timesheet/version.rb +1 -1
- data/lib/txt_timesheet.rb +8 -13
- data/txt_timesheet.gemspec +6 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d4fe4d699dcd22d32ed9f7cb817ce4e61f4f3122777e3898ec62389bb041a0
|
4
|
+
data.tar.gz: 0b7930337240323c931045e5bedd6d5430246f0eeb89acfd5cb3c19acf78e962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17b440a82bd1eb7f699f31d59ebed2603b9a3aafe06a174b492b1e238170d850f94e664aa33047dac0be483137f80383cce1bb593f2db65f5852ea86b8030383
|
7
|
+
data.tar.gz: 1cd6cf3426c68c9a0a7ffe34cc1b339962b49bd5abfdde0ca45908b86e7c67d2ac4c1bb9d5053ba4f3de42000aa96ed9ff63f284d40301870fa766a67a0d12f3
|
data/bin/timesheet
CHANGED
data/lib/txt_timesheet.rb
CHANGED
@@ -2,22 +2,17 @@
|
|
2
2
|
|
3
3
|
# Treat past files as a parameter and calculate total hours worked
|
4
4
|
class TxtTimesheet
|
5
|
-
|
5
|
+
|
6
|
+
def convert(time_in_minutes)
|
6
7
|
### Convert working time to hh:mm format
|
7
|
-
hours =
|
8
|
-
|
9
|
-
minutes = par - hours * 60
|
8
|
+
hours = time_in_minutes / 60
|
9
|
+
minutes = time_in_minutes - hours * 60
|
10
10
|
## Add 0 to keep hh: mm format
|
11
|
-
|
12
|
-
minutes = "0#{minutes}" if minutes < 10
|
13
|
-
|
14
|
-
time = "#{hours}:#{minutes}"
|
15
|
-
|
16
|
-
time
|
11
|
+
"%02d:%02d" % [hours, minutes]
|
17
12
|
end
|
18
|
-
|
13
|
+
|
19
14
|
def run
|
20
|
-
time_regex = /(?<hours>\d
|
15
|
+
time_regex = /(?<hours>\d+)\:(?<minutes>\d+)/
|
21
16
|
total_time = 0
|
22
17
|
|
23
18
|
puts 'REPORT:'
|
@@ -68,7 +63,7 @@ class TxtTimesheet
|
|
68
63
|
end
|
69
64
|
###
|
70
65
|
|
71
|
-
###
|
66
|
+
### Calculates worked time in minutes
|
72
67
|
index = 0
|
73
68
|
while index < input_count
|
74
69
|
sum_time = time_in_min[index + 1] - time_in_min[index] + sum_time
|
data/txt_timesheet.gemspec
CHANGED
@@ -2,7 +2,7 @@ require_relative 'lib/txt_timesheet/version'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "txt_timesheet"
|
5
|
-
spec.version =
|
5
|
+
spec.version = TxtTimesheet::VERSION
|
6
6
|
spec.authors = ["Elvis Serrão"]
|
7
7
|
spec.email = ["elvis.serrao1@gmail.com"]
|
8
8
|
|
@@ -12,7 +12,11 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
14
|
|
15
|
-
spec.metadata
|
15
|
+
spec.metadata = {
|
16
|
+
'homepage_uri' => 'https://elvisserrao.github.io/',
|
17
|
+
'source_code_uri' => 'https://github.com/elvisserrao/txt-timesheet'
|
18
|
+
}
|
19
|
+
|
16
20
|
|
17
21
|
# Specify which files should be added to the gem when it is released.
|
18
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: txt_timesheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elvis Serrão
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Receive n files as command line parameters, parse these files and than,
|
14
14
|
calculates how many hours has been worked .
|
@@ -39,6 +39,7 @@ licenses:
|
|
39
39
|
- MIT
|
40
40
|
metadata:
|
41
41
|
homepage_uri: https://elvisserrao.github.io/
|
42
|
+
source_code_uri: https://github.com/elvisserrao/txt-timesheet
|
42
43
|
post_install_message:
|
43
44
|
rdoc_options: []
|
44
45
|
require_paths:
|