toggl-worktime 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/lib/toggl/worktime/merger.rb +6 -4
- data/lib/toggl/worktime/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd9c63f2884fb32f927ce384477911a5a87984cc18a6ffa7d6cec577ed5eb9b6
|
4
|
+
data.tar.gz: 2ce8946cf15a0b258d18820cc5347656cc2c7b089ae21122571b158cd32c5f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fda7e45a8e887561adc06a3e24f98f0c50a225b8188756c8cfa6576ed9bc27274505069342e077c32de17f846013728be73813f2478715e530b5d759198358f
|
7
|
+
data.tar.gz: eae7f300a27c108b2db455c6459eaa1c05319de6f2ccad040b5ec0d490fc8aece985b75e784108f341130d5ee961323a68881439a93aa9a17fac3a8231d9e3d8
|
data/.rubocop.yml
CHANGED
@@ -8,7 +8,7 @@ module Toggl
|
|
8
8
|
class Merger
|
9
9
|
attr_reader :total_time
|
10
10
|
|
11
|
-
|
11
|
+
ONE_MINUTE_SECONDS = 60
|
12
12
|
|
13
13
|
def initialize(time_entries, config)
|
14
14
|
@time_entries = time_entries
|
@@ -28,10 +28,12 @@ module Toggl
|
|
28
28
|
next
|
29
29
|
end
|
30
30
|
work_time << [@current_start, @current_stop]
|
31
|
+
@total_time += @current_stop - @current_start
|
31
32
|
@current_start = start
|
32
33
|
@current_stop = stop
|
33
34
|
end
|
34
35
|
work_time << [@current_start, @last_stop]
|
36
|
+
@total_time += @current_stop - @current_start
|
35
37
|
work_time
|
36
38
|
end
|
37
39
|
|
@@ -45,8 +47,6 @@ module Toggl
|
|
45
47
|
@current_stop = stop if @current_stop.nil?
|
46
48
|
if start.nil? || stop.nil?
|
47
49
|
warn 'start or stop time is nil: total time may be incomplete'
|
48
|
-
else
|
49
|
-
@total_time += stop - start
|
50
50
|
end
|
51
51
|
yield [start, stop]
|
52
52
|
end
|
@@ -54,12 +54,14 @@ module Toggl
|
|
54
54
|
|
55
55
|
def parse_date(date, zone_offset)
|
56
56
|
return nil if date.nil?
|
57
|
+
|
57
58
|
::Time.parse(date).getlocal(zone_offset)
|
58
59
|
end
|
59
60
|
|
60
61
|
def continuing(start)
|
61
62
|
return true if @current_stop.nil?
|
62
|
-
|
63
|
+
|
64
|
+
interval = (start - @current_stop) / ONE_MINUTE_SECONDS
|
63
65
|
@continuing = interval < @config.working_interval_min
|
64
66
|
end
|
65
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toggl-worktime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomoya KABE
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|