ttrack 0.3.3 → 0.4.0
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.
- data/bin/ttrack +4 -2
- data/lib/ttrack.rb +8 -4
- metadata +4 -4
data/bin/ttrack
CHANGED
@@ -11,8 +11,9 @@ case ARGV[0]
|
|
11
11
|
when 'start' then
|
12
12
|
stop = tt.start(ARGV[1], ARGV[2])
|
13
13
|
if stop and not stop[1].nil?
|
14
|
-
puts 'Stop tracking issue "%s", run for %s' % [
|
14
|
+
puts 'Stop tracking issue "%s", run for %s%s' % [
|
15
15
|
stop[1][:name],
|
16
|
+
stop[1][:elapseddays] > 0 ? "%s days " % stop[1][:elapseddays] : '',
|
16
17
|
Time.at(stop[1][:elapsed]).utc.strftime("%H hours %M minutes %S seconds")
|
17
18
|
]
|
18
19
|
puts 'Start tracking issue "%s"' % ARGV[1]
|
@@ -25,8 +26,9 @@ case ARGV[0]
|
|
25
26
|
when 'stop' then
|
26
27
|
stop = tt.stop
|
27
28
|
if stop
|
28
|
-
puts 'Stop issue "%s", run for %s' % [
|
29
|
+
puts 'Stop issue "%s", run for %s%s' % [
|
29
30
|
stop[:name],
|
31
|
+
stop[:elapseddays] > 0 ? "%s days " % stop[:elapseddays] : '',
|
30
32
|
Time.at(stop[:elapsed]).utc.strftime("%H hours %M minutes %S seconds")
|
31
33
|
]
|
32
34
|
else
|
data/lib/ttrack.rb
CHANGED
@@ -28,7 +28,11 @@ class TTrack
|
|
28
28
|
def stop
|
29
29
|
result = @db.stoprunning
|
30
30
|
if result and result != []
|
31
|
-
{ :name => @db.getnamebyissueid(result)[0][0],
|
31
|
+
{ :name => @db.getnamebyissueid(result)[0][0],
|
32
|
+
:id => result,
|
33
|
+
:elapsed => getissueduration(result),
|
34
|
+
:elapseddays => getissueduration(result) / 86400
|
35
|
+
}
|
32
36
|
else
|
33
37
|
false
|
34
38
|
end
|
@@ -66,7 +70,7 @@ class TTrack
|
|
66
70
|
:tstop => line[3],
|
67
71
|
:synced => line[4],
|
68
72
|
:notes => line[5],
|
69
|
-
:elapsed => getissueduration(line[0])
|
73
|
+
:elapsed => getissueduration(line[0]),
|
70
74
|
}
|
71
75
|
end
|
72
76
|
else
|
@@ -78,7 +82,7 @@ class TTrack
|
|
78
82
|
:tstop => line[2],
|
79
83
|
:synced => line[3],
|
80
84
|
:notes => line[4],
|
81
|
-
:elapsed => getissueduration(line[0])
|
85
|
+
:elapsed => getissueduration(line[0]),
|
82
86
|
}
|
83
87
|
end
|
84
88
|
end
|
@@ -173,7 +177,7 @@ class TTrack
|
|
173
177
|
def getissueduration issueid
|
174
178
|
timestamps = @db.gettime issueid
|
175
179
|
t0, t1 = gettimeobject(timestamps[0]), gettimeobject(timestamps[1])
|
176
|
-
t1 - t0
|
180
|
+
(t1 - t0).to_int
|
177
181
|
end
|
178
182
|
|
179
183
|
def gettstart issueid
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ttrack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|
16
|
-
requirement: &
|
16
|
+
requirement: &70367083954340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 1.3.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70367083954340
|
25
25
|
description: A simple CLI time tracker
|
26
26
|
email: alexander.fortin@gmail.com
|
27
27
|
executables:
|