timecard 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/VERSION +1 -1
- data/lib/timecard.rb +11 -5
- data/timecard.gemspec +53 -0
- metadata +3 -2
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/timecard.rb
CHANGED
@@ -55,10 +55,7 @@ module Timecard
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def time_loop_transition(command)
|
58
|
-
|
59
|
-
@start_time = nil
|
60
|
-
|
61
|
-
case command
|
58
|
+
valid_command = case command
|
62
59
|
when 'p'
|
63
60
|
:pause_task
|
64
61
|
when 'f'
|
@@ -66,6 +63,15 @@ module Timecard
|
|
66
63
|
when 'q'
|
67
64
|
:finish_and_quit
|
68
65
|
end
|
66
|
+
|
67
|
+
if ! valid_command
|
68
|
+
await_input
|
69
|
+
else
|
70
|
+
@tasks.last[:time_pairs] << [@start_time, Time.now]
|
71
|
+
@start_time = nil
|
72
|
+
end
|
73
|
+
|
74
|
+
valid_command
|
69
75
|
end
|
70
76
|
|
71
77
|
def pause_task
|
@@ -77,7 +83,7 @@ module Timecard
|
|
77
83
|
next_state = process_input { |input| :time_loop }
|
78
84
|
return next_state if next_state
|
79
85
|
|
80
|
-
sleep(0.
|
86
|
+
sleep(0.1)
|
81
87
|
end
|
82
88
|
end
|
83
89
|
|
data/timecard.gemspec
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{timecard}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Gabe da Silveira"]
|
12
|
+
s.date = %q{2011-07-18}
|
13
|
+
s.description = %q{Simple UNIX shell time tracker}
|
14
|
+
s.email = %q{gabe@websaviour.com}
|
15
|
+
s.executables = ["timecard"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE.txt",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
"CHANGELOG",
|
22
|
+
"LICENSE.txt",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"bin/timecard",
|
27
|
+
"lib/timecard.rb",
|
28
|
+
"spec/spec_helper.rb",
|
29
|
+
"spec/timecard_spec.rb",
|
30
|
+
"timecard.gemspec"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/dasil003/timecard}
|
33
|
+
s.licenses = ["MIT"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.7.2}
|
36
|
+
s.summary = %q{Simple CLI time tracker}
|
37
|
+
|
38
|
+
if s.respond_to? :specification_version then
|
39
|
+
s.specification_version = 3
|
40
|
+
|
41
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
42
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
43
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.3"])
|
44
|
+
else
|
45
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
46
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
47
|
+
end
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
50
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: timecard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Gabe da Silveira
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-18 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/timecard.rb
|
54
54
|
- spec/spec_helper.rb
|
55
55
|
- spec/timecard_spec.rb
|
56
|
+
- timecard.gemspec
|
56
57
|
homepage: http://github.com/dasil003/timecard
|
57
58
|
licenses:
|
58
59
|
- MIT
|