txt_timesheet 1.1.0 → 1.1.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: b6596a32ce5541ce5f745f3e5e7aa782f7b09a90871c4b32cfd0d81e63d3492b
4
- data.tar.gz: ea41caebe92dce71fc6c1c38bd87521288c13307e1279b5b7d583babcf421bc3
3
+ metadata.gz: 7a3eb2978c3026294a3c4919e04ae49804b65847135ba26b5a083bc15c05ee73
4
+ data.tar.gz: 83c3438aff54827483d4be9d31fc717c8e98bfd504d976c8ff3cdbba871bcf99
5
5
  SHA512:
6
- metadata.gz: 745a94696c2cf35c8723eaa69aa8b5e5773266c84d56ce3d0b2bf5172a166896e42de840e54da0bd0413f327b386c387d4ee58b9b448c121b91fd6187e7757c8
7
- data.tar.gz: 2af6c19d63885f3a941dcb71aa72c36a7ccf5d8ae7b68614b335ec7cd0a510314ac2bcab5b490f6faf110d5a9150c5375c787943a21edb74a468e1f497d41bb5
6
+ metadata.gz: 1376ae880cbdae6e44ad01cf5b06092128f63ef2e68cce7f8a78046d35a02a6321e695c96cc0174832ee1621b2779b49e9a59a05d22efd4707de0e439e02c83a
7
+ data.tar.gz: f7d289a31b0a267fe8a35ec419e161550b73f7476d3a5fd181a4b51de76fa601f4826be3ecea41df712a84c32cae98b29a88d171c13f46e1bba96c1bf79ba164
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
 
2
2
  .idea/
3
+ *.gem
data/lib/txt_timesheet.rb CHANGED
@@ -1,4 +1,24 @@
1
1
  class Txt_timesheet
2
+
3
+ def convert (par)
4
+ ### Converte o tempo trabalhado para o formato hh:mm
5
+ hours = par/60
6
+ hours = hours.to_i
7
+ minutes = par - hours * 60
8
+ ## Adiciona o 0 para manter o padrão de 2 algarismos do padrão hh:mm
9
+ if hours < 10
10
+ hours = "0#{hours}"
11
+ end
12
+ if minutes < 10
13
+ minutes = "0#{minutes}"
14
+ end
15
+
16
+ time = "#{hours}:#{minutes}"
17
+
18
+ return time
19
+
20
+ end
21
+
2
22
  def run
3
23
  time_regex = /(?<hours>\d{2})\:(?<minutes>\d{2})/
4
24
  total_time = 0
@@ -59,20 +79,7 @@ class Txt_timesheet
59
79
  end
60
80
  ###
61
81
 
62
- ### Converte o tempo trabalhado para o formato hh:mm
63
- hours = sum_time/60
64
- hours = hours.to_i
65
- minutes = sum_time - hours * 60
66
- ## Adiciona o 0 para manter o padrão de 2 algarismos do padrão hh:mm
67
- if hours < 10
68
- hours = "0#{hours}"
69
- end
70
- if minutes < 10
71
- minutes = "0#{minutes}"
72
- end
73
- ##
74
-
75
- time_file = "#{hours}:#{minutes}"
82
+ time_file = convert(sum_time)
76
83
  print "#{files}: #{time_file} hours\n"
77
84
  ###
78
85
 
@@ -80,11 +87,12 @@ class Txt_timesheet
80
87
 
81
88
  end
82
89
 
90
+ time_file = convert(total_time)
83
91
  ### Converts the total worked time
84
92
  hours = total_time/60
85
93
  hours = hours.to_i
86
94
  minutes = total_time - hours * 60
87
- puts "Total Hours: #{hours}:#{minutes} hours"
95
+ puts "Total Hours: #{time_file} hours\n"
88
96
  ###
89
97
 
90
98
 
@@ -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 = "1.1.0"
5
+ spec.version = "1.1.1"
6
6
  spec.authors = ["Elvis Serrão"]
7
7
  spec.email = ["elvis.serrao1@gmail.com"]
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txt_timesheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elvis Serrão
@@ -29,7 +29,6 @@ files:
29
29
  - bin/setup
30
30
  - lib/txt_timesheet.rb
31
31
  - lib/txt_timesheet/version.rb
32
- - txt_timesheet-0.1.0.gem
33
32
  - txt_timesheet.gemspec
34
33
  homepage: https://elvisserrao.github.io/
35
34
  licenses:
Binary file