timetrap 1.5.1 → 1.5.2
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/VERSION.yml +1 -1
- data/lib/timetrap/cli.rb +12 -1
- data/spec/spec.opts +1 -0
- data/spec/timetrap_spec.rb +25 -1
- data/timetrap.gemspec +3 -2
- metadata +5 -4
data/VERSION.yml
CHANGED
data/lib/timetrap/cli.rb
CHANGED
@@ -30,7 +30,7 @@ COMMAND is one of:
|
|
30
30
|
the -r flag
|
31
31
|
database_file: The file path of the sqlite database
|
32
32
|
append_notes_delimiter: delimiter used when appending notes via
|
33
|
-
t edit --append
|
33
|
+
t edit --append
|
34
34
|
|
35
35
|
* display - Display the current timesheet or a specific. Pass `all' as
|
36
36
|
SHEET to display all sheets.
|
@@ -49,6 +49,7 @@ COMMAND is one of:
|
|
49
49
|
-z, --append Append to the current note instead of replacing it
|
50
50
|
the delimiter between appended notes is
|
51
51
|
configurable (see configure)
|
52
|
+
-m, --move <sheet> Move to another sheet
|
52
53
|
|
53
54
|
* format - Deprecated: alias for display.
|
54
55
|
|
@@ -145,6 +146,16 @@ COMMAND is one of:
|
|
145
146
|
say "can't find entry" && return unless entry
|
146
147
|
entry.update :start => args['-s'] if args['-s'] =~ /.+/
|
147
148
|
entry.update :end => args['-e'] if args['-e'] =~ /.+/
|
149
|
+
|
150
|
+
# update sheet
|
151
|
+
if args['-m'] =~ /.+/
|
152
|
+
if entry == Timetrap.active_entry
|
153
|
+
Timetrap.current_sheet = args['-m']
|
154
|
+
end
|
155
|
+
entry.update :sheet => args['-m']
|
156
|
+
end
|
157
|
+
|
158
|
+
# update notes
|
148
159
|
if unused_args =~ /.+/
|
149
160
|
note = unused_args
|
150
161
|
if args['-z']
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/timetrap_spec.rb
CHANGED
@@ -12,6 +12,7 @@ module Timetrap::StubConfig
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe Timetrap do
|
15
|
+
include Timetrap::StubConfig
|
15
16
|
def create_entry atts = {}
|
16
17
|
Timetrap::Entry.create({
|
17
18
|
:sheet => 'default',
|
@@ -88,8 +89,31 @@ describe Timetrap do
|
|
88
89
|
Timetrap.active_entry.note.should == 'new description'
|
89
90
|
end
|
90
91
|
|
92
|
+
it "should allow you to move an entry to another sheet" do
|
93
|
+
invoke 'edit --move blahblah'
|
94
|
+
Timetrap.active_entry[:sheet].should == 'blahblah'
|
95
|
+
invoke 'edit -m blahblahblah'
|
96
|
+
Timetrap.active_entry[:sheet].should == 'blahblahblah'
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should change the current sheet if the current entry's sheet is changed" do
|
100
|
+
Timetrap.current_sheet.should_not == 'blahblahblah'
|
101
|
+
invoke 'edit -m blahblahblah'
|
102
|
+
Timetrap.active_entry[:sheet].should == 'blahblahblah'
|
103
|
+
Timetrap.current_sheet.should == 'blahblahblah'
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should change the current sheet if a non current entry's sheet is changed" do
|
107
|
+
sheet = Timetrap.current_sheet
|
108
|
+
id = Timetrap.active_entry[:id]
|
109
|
+
invoke 'out'
|
110
|
+
invoke "edit -m blahblahblah -i #{id}"
|
111
|
+
Timetrap.current_sheet.should == sheet
|
112
|
+
Timetrap::Entry[id][:sheet].should == 'blahblahblah'
|
113
|
+
end
|
114
|
+
|
91
115
|
it "should allow appending to the description of the active period" do
|
92
|
-
|
116
|
+
with_stubbed_config('append_notes_delimiter' => '//')
|
93
117
|
Timetrap.active_entry.note.should == 'running entry'
|
94
118
|
invoke 'edit --append new'
|
95
119
|
Timetrap.active_entry.note.should == 'running entry//new'
|
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.5.
|
8
|
+
s.version = "1.5.2"
|
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{2010-
|
12
|
+
s.date = %q{2010-11-15}
|
13
13
|
s.default_executable = %q{t}
|
14
14
|
s.description = %q{Command line time tracker}
|
15
15
|
s.email = %q{sgrock@gmail.com}
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"lib/timetrap/formatters/text.rb",
|
36
36
|
"lib/timetrap/helpers.rb",
|
37
37
|
"lib/timetrap/models.rb",
|
38
|
+
"spec/spec.opts",
|
38
39
|
"spec/timetrap_spec.rb",
|
39
40
|
"timetrap.gemspec"
|
40
41
|
]
|
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:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 1.5.
|
9
|
+
- 2
|
10
|
+
version: 1.5.2
|
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: 2010-
|
18
|
+
date: 2010-11-15 00:00:00 -08:00
|
19
19
|
default_executable: t
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/timetrap/formatters/text.rb
|
124
124
|
- lib/timetrap/helpers.rb
|
125
125
|
- lib/timetrap/models.rb
|
126
|
+
- spec/spec.opts
|
126
127
|
- spec/timetrap_spec.rb
|
127
128
|
- timetrap.gemspec
|
128
129
|
has_rdoc: true
|