txt_timesheet 1.1.6 → 1.1.7

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: 89d4fe4d699dcd22d32ed9f7cb817ce4e61f4f3122777e3898ec62389bb041a0
4
- data.tar.gz: 0b7930337240323c931045e5bedd6d5430246f0eeb89acfd5cb3c19acf78e962
3
+ metadata.gz: 1b888853a5d85fa26280f88f5712a79c29bd31c68aeb61ab4aa3a6ed457d2da5
4
+ data.tar.gz: 350f5f8e89bd98e6f958fec7b9245b80d629a012970ba2731e9394fc19455de8
5
5
  SHA512:
6
- metadata.gz: 17b440a82bd1eb7f699f31d59ebed2603b9a3aafe06a174b492b1e238170d850f94e664aa33047dac0be483137f80383cce1bb593f2db65f5852ea86b8030383
7
- data.tar.gz: 1cd6cf3426c68c9a0a7ffe34cc1b339962b49bd5abfdde0ca45908b86e7c67d2ac4c1bb9d5053ba4f3de42000aa96ed9ff63f284d40301870fa766a67a0d12f3
6
+ metadata.gz: 1b9e2d2d3a6db8b1a7c6d462872e67de29e4ab4f66592f0ba8d5f74dee75b1e99a0a20cd06145e82a229b3a2c0171af63469250d39ff404eac67d684ff313b2f
7
+ data.tar.gz: f3d7d4a57c645f1f81200c10c57a2270da69e3dc4b775bfec4bc39c21cace0d486d61b034f9a19a1b50f7a62905bd1f6d81d0e977bc74a842c790f3785004d69
@@ -0,0 +1,11 @@
1
+
2
+ module Timesheet
3
+
4
+ def convert(time_in_minutes)
5
+ ### Convert working time to hh:mm format
6
+ hours = time_in_minutes / 60
7
+ minutes = time_in_minutes - hours * 60
8
+ ## Add 0 to keep hh: mm format
9
+ "%02d:%02d" % [hours, minutes]
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module TxtTimesheet
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
data/lib/txt_timesheet.rb CHANGED
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'txt_timesheet/convert'
4
+
3
5
  # Treat past files as a parameter and calculate total hours worked
4
6
  class TxtTimesheet
5
7
 
6
- def convert(time_in_minutes)
7
- ### Convert working time to hh:mm format
8
- hours = time_in_minutes / 60
9
- minutes = time_in_minutes - hours * 60
10
- ## Add 0 to keep hh: mm format
11
- "%02d:%02d" % [hours, minutes]
12
- end
13
-
8
+ include Timesheet
9
+
14
10
  def run
15
11
  time_regex = /(?<hours>\d+)\:(?<minutes>\d+)/
16
12
  total_time = 0
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.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elvis Serrão
@@ -21,19 +21,12 @@ executables:
21
21
  extensions: []
22
22
  extra_rdoc_files: []
23
23
  files:
24
- - ".gitignore"
25
- - ".travis.yml"
26
- - Gemfile
27
- - Gemfile.lock
28
- - LICENSE.txt
29
- - README.md
30
- - Rakefile
31
24
  - bin/console
32
25
  - bin/setup
33
26
  - bin/timesheet
34
27
  - lib/txt_timesheet.rb
28
+ - lib/txt_timesheet/convert.rb
35
29
  - lib/txt_timesheet/version.rb
36
- - txt_timesheet.gemspec
37
30
  homepage: https://elvisserrao.github.io/
38
31
  licenses:
39
32
  - MIT
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
-
2
- .idea/
3
- *.gem
4
- assets/
5
- *.txt
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.6.5
6
- before_install: gem install bundler -v 2.1.0.pre.2
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in txt_timesheet.gemspec
4
- gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
data/Gemfile.lock DELETED
@@ -1,34 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- txt_timesheet (1.1.3)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.3)
10
- rake (12.3.2)
11
- rspec (3.9.0)
12
- rspec-core (~> 3.9.0)
13
- rspec-expectations (~> 3.9.0)
14
- rspec-mocks (~> 3.9.0)
15
- rspec-core (3.9.0)
16
- rspec-support (~> 3.9.0)
17
- rspec-expectations (3.9.0)
18
- diff-lcs (>= 1.2.0, < 2.0)
19
- rspec-support (~> 3.9.0)
20
- rspec-mocks (3.9.0)
21
- diff-lcs (>= 1.2.0, < 2.0)
22
- rspec-support (~> 3.9.0)
23
- rspec-support (3.9.0)
24
-
25
- PLATFORMS
26
- x64-mingw32
27
-
28
- DEPENDENCIES
29
- rake (~> 12.0)
30
- rspec (~> 3.0)
31
- txt_timesheet!
32
-
33
- BUNDLED WITH
34
- 2.1.0.pre.2
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019 Elvis Serrão
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,72 +0,0 @@
1
-
2
-
3
- Txt-timesheet [![Gem Version](https://badge.fury.io/rb/txt_timesheet.svg)](https://badge.fury.io/rb/txt_timesheet)
4
- ====================
5
-
6
- Timesheet calculator for .txt files.
7
-
8
- Installation
9
- ------------
10
- gem install txt_timesheet
11
-
12
- How it works
13
- ------------
14
-
15
- Given 3 files like these
16
-
17
- `file1.txt`:
18
-
19
-
20
- ## Timesheet
21
-
22
- morning: 09:13
23
- brb lunch: 12:03
24
- back: 13:56
25
- leaving: 20:53
26
-
27
- ## What Happened?
28
-
29
-
30
- `file2.txt`:
31
-
32
- ## Timesheet
33
-
34
- morning: 09:59
35
- brb lunch: 12:07
36
- back: 13:40
37
- brb: 18:41
38
- back: 20:53
39
- leaving: 22:53
40
-
41
- ## Daily report
42
-
43
- Leaving:
44
-
45
- `file3.txt`:
46
-
47
- ## Timesheet
48
-
49
- morning: 09:45
50
- brb lunch: 12:28
51
- back: 13:31
52
- brb: 18:07
53
- back: 23:11
54
- leaving: 23:11
55
-
56
- ## Daily report
57
-
58
- Leaving:
59
- - syncs with Flávia, and with Iago and Arthur
60
- - started working on CRM side to create user with password in authenticator
61
-
62
-
63
- Your output should be like this:
64
-
65
- $ timesheet file1.txt file2.txt file3.txt
66
-
67
- REPORT:
68
- file1.txt: 09:47 hours
69
- file2.txt: 09:09 hours
70
- file3.txt: 07:19 hours
71
- Total Hours: 26:15 hours
72
-
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,29 +0,0 @@
1
- require_relative 'lib/txt_timesheet/version'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "txt_timesheet"
5
- spec.version = TxtTimesheet::VERSION
6
- spec.authors = ["Elvis Serrão"]
7
- spec.email = ["elvis.serrao1@gmail.com"]
8
-
9
- spec.summary = %q{Calculate Timesheet.}
10
- spec.description = %q{Receive n files as command line parameters, parse these files and than, calculates how many hours has been worked .}
11
- spec.homepage = "https://elvisserrao.github.io/"
12
- spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
-
15
- spec.metadata = {
16
- 'homepage_uri' => 'https://elvisserrao.github.io/',
17
- 'source_code_uri' => 'https://github.com/elvisserrao/txt-timesheet'
18
- }
19
-
20
-
21
- # Specify which files should be added to the gem when it is released.
22
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
- end
26
- spec.bindir = "bin"
27
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
29
- end