tlog 0.2.4 → 0.2.5
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.
- checksums.yaml +8 -8
- data/lib/tlog.rb +1 -1
- data/lib/tlog/command/display.rb +0 -1
- data/lib/tlog/command/stop.rb +13 -9
- data/lib/tlog/storage/disk.rb +8 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZjVhNjc5ZTAzNTFmMThkMjRhZWUyYThlZDUyNjRkOGZjZDc5ZTM5Yg==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZjgxZTcxMzlhZmE5NzAxZjhiZGIzZmQ4YTRhYjQ2MzUwNzJhMGJkOQ==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YjE0ZmQ1NTBjMDIxMzVjMzUxYjI5NzI5NDBlOTFjOGE1OGYzMDcxOThmMjYx
|
|
10
|
+
NmJhZTUyYjIzZDg4ODQxNzlkNWRmMGQ5OTI1MmM2NTE2NmJjYWI5ZWVjMDA4
|
|
11
|
+
MWRhYTZlOTZjYmJhYjcwODc5OWZmMzI0OTc0ZWZmMmM3OTlkOGY=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MzEzZjgyMTQyZDdiYjM5ODk5YjFhMmIxZTYyYjVhZDQ5YmRiODRhZTVlMWY3
|
|
14
|
+
MDljNGU1ZTczZmYxZmIyYTA1ZDIwMjM1YjkzNTBiYjkxZGE5NTExNDRjMjZk
|
|
15
|
+
NzM0YWUyNTU5NmI3NjU1MjQ1ZTMxYWEwNzJkZTdkNTViNWNjNTY=
|
data/lib/tlog.rb
CHANGED
data/lib/tlog/command/display.rb
CHANGED
data/lib/tlog/command/stop.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
class Tlog::Command::Stop < Tlog::Command
|
|
2
3
|
|
|
3
4
|
def name
|
|
@@ -11,26 +12,29 @@ class Tlog::Command::Stop < Tlog::Command
|
|
|
11
12
|
def execute(input, output)
|
|
12
13
|
updated_log = stop
|
|
13
14
|
output.line("Stopped '#{updated_log.name}'")
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
output.line("'#{commit_message}': Commiting working changes on current branch")
|
|
15
|
+
current_branch = storage.current_branch
|
|
16
|
+
if input.options[:all]
|
|
17
|
+
commit_output = commit_working_changes(input.options[:message])
|
|
18
|
+
commit_message = input.options[:message]
|
|
19
|
+
output.line("#{commit_output}")
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def options(parser, options)
|
|
24
|
-
parser.banner = "usage:
|
|
24
|
+
parser.banner = "usage: tlo stop"
|
|
25
|
+
|
|
26
|
+
parser.on("-a", "--all", "Stop current time log and commit tracked working changes") do |all|
|
|
27
|
+
options[:all] = all
|
|
28
|
+
end
|
|
25
29
|
|
|
26
|
-
parser.on("-
|
|
30
|
+
parser.on("-m", "--message <commit_message>", "The commit message you want to be associated with this commit") do |message|
|
|
27
31
|
options[:message] = message
|
|
28
32
|
end
|
|
29
33
|
end
|
|
30
34
|
|
|
31
35
|
private
|
|
32
36
|
|
|
33
|
-
def stop
|
|
37
|
+
def stop
|
|
34
38
|
storage.in_branch do |wd|
|
|
35
39
|
checked_out_log = storage.checkout_value
|
|
36
40
|
raise Tlog::Error::CheckoutInvalid, "No time log is checked out" unless checked_out_log
|
data/lib/tlog/storage/disk.rb
CHANGED
|
@@ -126,7 +126,7 @@ class Tlog::Storage::Disk
|
|
|
126
126
|
if current_log_name == log_name
|
|
127
127
|
duration += time_since_start
|
|
128
128
|
end
|
|
129
|
-
log_entries(log_name).each do |entry|
|
|
129
|
+
log_entries(log_name).each do |entry|
|
|
130
130
|
duration += entry.length
|
|
131
131
|
end
|
|
132
132
|
duration
|
|
@@ -178,13 +178,17 @@ class Tlog::Storage::Disk
|
|
|
178
178
|
Pathname.new(logs_path).children.select { |c| c.directory? } if Dir.exists?(logs_path)
|
|
179
179
|
end
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
def current_branch
|
|
182
|
+
git.lib.branch_current
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Temporarily switches to tlog branch
|
|
182
186
|
def in_branch(branch_exists = true)
|
|
183
187
|
unless File.directory?(@tlog_working)
|
|
184
188
|
FileUtils.mkdir_p(@tlog_working)
|
|
185
189
|
end
|
|
186
190
|
|
|
187
|
-
old_current =
|
|
191
|
+
old_current = current_branch
|
|
188
192
|
begin
|
|
189
193
|
git.lib.change_head_branch('tlog')
|
|
190
194
|
git.with_index(@tlog_index) do
|
|
@@ -208,8 +212,6 @@ class Tlog::Storage::Disk
|
|
|
208
212
|
def decode_log_path(log_path)
|
|
209
213
|
if Dir.exists?(log_path)
|
|
210
214
|
log = Tlog::Entity::Log.new(log_path)
|
|
211
|
-
#log_storage.log_path = log_path # add this to the log class...i think task_store may not be neccessary
|
|
212
|
-
#lgolog.entries = log_storage.entries
|
|
213
215
|
end
|
|
214
216
|
return log
|
|
215
217
|
end
|
|
@@ -251,7 +253,7 @@ class Tlog::Storage::Disk
|
|
|
251
253
|
FileUtils.rm(checkout_path)
|
|
252
254
|
end
|
|
253
255
|
else
|
|
254
|
-
|
|
256
|
+
false
|
|
255
257
|
end
|
|
256
258
|
end
|
|
257
259
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tlog
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Wendel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: commander
|