ttrack 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/ttrack CHANGED
@@ -9,7 +9,14 @@ databasename = "%s/%s" % [ENV['HOME'], ".timetrackerdb"]
9
9
  tt = TTrack.new databasename
10
10
  case ARGV[0]
11
11
  when 'start' then
12
- if tt.start(ARGV[1], ARGV[2])
12
+ stop = tt.start(ARGV[1], ARGV[2])
13
+ if stop and not stop[1].nil?
14
+ puts 'Stop tracking issue "%s", run for %s' % [
15
+ stop[1][:name],
16
+ Time.at(stop[1][:elapsed]).utc.strftime("%H hours %M minutes %S seconds")
17
+ ]
18
+ puts 'Start tracking issue "%s"' % ARGV[1]
19
+ elsif stop
13
20
  puts 'Start tracking issue "%s"' % ARGV[1]
14
21
  else
15
22
  usage(tt)
@@ -3,7 +3,7 @@ require 'sqlite3'
3
3
 
4
4
  class TTrack::DataStore
5
5
 
6
- def initialize dbname, timezone="+02:00", version='v0.2.1', verbosity=0
6
+ def initialize dbname, timezone="+02:00", version='v0.2.2', verbosity=0
7
7
  @dbname = dbname
8
8
  @timezone = timezone
9
9
  @version = version
data/lib/ttrack.rb CHANGED
@@ -15,9 +15,9 @@ class TTrack
15
15
  # Return boolean to indicate if the action was succesfull or not
16
16
  def start issuename, notes=''
17
17
  unless issuename.nil? or issuename.empty?
18
- @db.stoprunning if @db.getcurrent
18
+ stopresult = stop if @db.getcurrent
19
19
  @db.startnew issuename, notes
20
- true
20
+ [true, stopresult]
21
21
  else
22
22
  false
23
23
  end
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.2.1
4
+ version: 0.2.2
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: 2012-10-15 00:00:00.000000000Z
12
+ date: 2012-10-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
16
- requirement: &70168324648680 !ruby/object:Gem::Requirement
16
+ requirement: &70193401746200 !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: *70168324648680
24
+ version_requirements: *70193401746200
25
25
  description: A simple CLI time tracker
26
26
  email: alexander.fortin@gmail.com
27
27
  executables: