timetrap 1.7.9 → 1.7.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 7
4
- :patch: 9
4
+ :patch: 10
@@ -18,7 +18,7 @@ module Timetrap
18
18
  end
19
19
 
20
20
  def end= time
21
- self[:end]= Timer.process_time(time, self[:start])
21
+ self[:end]= Timer.process_time(time)
22
22
  end
23
23
 
24
24
  def start
@@ -29,6 +29,10 @@ module Timetrap
29
29
  round? ? rounded_end : self[:end]
30
30
  end
31
31
 
32
+ def sheet
33
+ self[:sheet].to_s
34
+ end
35
+
32
36
  def duration
33
37
  @duration ||= self.end_or_now.to_i - self.start.to_i
34
38
  end
@@ -84,5 +88,9 @@ module Timetrap
84
88
  column :value, String
85
89
  end
86
90
  create_table unless table_exists?
91
+
92
+ def value
93
+ self[:value].to_s
94
+ end
87
95
  end
88
96
  end
@@ -1024,12 +1024,17 @@ END:VCALENDAR
1024
1024
  (3299..3301).should === @entry.duration
1025
1025
  end
1026
1026
 
1027
+ it "should not assume negative durations around 12 hour length" do
1028
+ @entry.start= Time.at(Time.now - (15 * 3600)) # 15.hour.ago
1029
+ @entry.end = Time.at(Time.now - 300).strftime("%H:%M:%S") # ambiguous 5.minutes.ago
1030
+
1031
+ (53699..53701).should === @entry.duration
1032
+ end
1033
+
1027
1034
  it "should assume a start time near the current time" do
1028
1035
  time = Time.at(Time.now - 300)
1029
1036
  @entry.start= time.strftime("%H:%M:%S") # ambiguous 5.minutes.ago
1030
1037
 
1031
- # should be about 55 minutes duration. Allow for second rollover
1032
- # within this test.
1033
1038
  @entry.start.to_i.should == time.to_i
1034
1039
  end
1035
1040
  end
data/timetrap.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{timetrap}
8
- s.version = "1.7.9"
8
+ s.version = "1.7.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sam Goldstein"]
12
- s.date = %q{2011-12-29}
12
+ s.date = %q{2011-12-30}
13
13
  s.default_executable = %q{t}
14
14
  s.description = %q{Command line time tracker}
15
15
  s.email = %q{sgrock@gmail.com}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timetrap
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 9
10
- version: 1.7.9
9
+ - 10
10
+ version: 1.7.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sam Goldstein
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-29 00:00:00 -08:00
18
+ date: 2011-12-30 00:00:00 -08:00
19
19
  default_executable: t
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency