ptimelog 0.13.0 → 0.13.1
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 +4 -4
- data/README.md +1 -0
- data/lib/ptimelog/entry.rb +13 -7
- data/lib/ptimelog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '032931c4e1d9382dc577f654d7b6a8eea2e6c2092d7eea33228bbf6bf50fdf18'
|
|
4
|
+
data.tar.gz: 5ff1e4d2306b46b287abb76e8be11b727c38161740222ba9b14de2bb2a89a399
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1cf90536e2c80a343986a14f9e1798415d0aebca0398866c7f797d4bbff71e5cd12832601a3011aafebf6c1139bc9eb486e97107c73ab337b6bdba34585fd472
|
|
7
|
+
data.tar.gz: 1da311745988d5530ef5b4b6aba5c5917df5b7aa7040a30c4c8f9e7f766ce8ca187b2eedb681e572720b3b818dba3d97363ebeba38da6affb3cfe5da8442ed9b
|
data/README.md
CHANGED
|
@@ -50,6 +50,7 @@ small tooling to transfer timelog-entries from gtimelog's timelog.txt or the tas
|
|
|
50
50
|
- [x] support upload-command: send the entries of a day to ptime
|
|
51
51
|
- [ ] support "last"-day for obsidian
|
|
52
52
|
- [x] filter the entries by tag
|
|
53
|
+
- [ ] Improve failure-handling of missing or broken inferers
|
|
53
54
|
|
|
54
55
|
## Installation
|
|
55
56
|
|
data/lib/ptimelog/entry.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'shellwords'
|
|
3
4
|
require 'time'
|
|
4
5
|
|
|
5
6
|
module Ptimelog
|
|
@@ -182,22 +183,27 @@ module Ptimelog
|
|
|
182
183
|
@script_name ||= first_tag
|
|
183
184
|
end
|
|
184
185
|
|
|
185
|
-
def
|
|
186
|
-
@
|
|
186
|
+
def inferer_args
|
|
187
|
+
[@script.inferer(script_name).to_s, @ticket.to_s, @description.to_s, *tail_tags.split]
|
|
187
188
|
end
|
|
188
189
|
|
|
189
190
|
def infer_entry_attributes
|
|
190
|
-
|
|
191
|
+
args = inferer_args
|
|
192
|
+
@inferer_cmd = args.shelljoin
|
|
191
193
|
|
|
192
|
-
|
|
193
|
-
@inferer_cmd = cmd
|
|
194
|
-
|
|
195
|
-
results = `#{cmd}`.chomp.split
|
|
194
|
+
results = run_inferer(args).chomp.split
|
|
196
195
|
account = results[0]
|
|
197
196
|
billable = ((results[1] || 'false').to_s == 'true' ? BILLABLE : NON_BILLABLE)
|
|
198
197
|
publishable = ((results[2] || 'true').to_s == 'true')
|
|
199
198
|
|
|
200
199
|
[account, billable, publishable]
|
|
201
200
|
end
|
|
201
|
+
|
|
202
|
+
def run_inferer(args)
|
|
203
|
+
IO.popen(args, &:read) # pass the read as a block to auto-close the stream
|
|
204
|
+
rescue SystemCallError => e
|
|
205
|
+
warn e.message
|
|
206
|
+
''
|
|
207
|
+
end
|
|
202
208
|
end
|
|
203
209
|
end
|
data/lib/ptimelog/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ptimelog
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.13.
|
|
4
|
+
version: 0.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthias Viehweger
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cmdparse
|