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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c9d0fcc6e0b89b70b4be7765118af54a493aa561dc6336fb03e070999dbdf95
4
- data.tar.gz: 3306a2c87d164e509cbc102d7173fb7480d00165a2c8fd56c0c5b1d05e0e4715
3
+ metadata.gz: '032931c4e1d9382dc577f654d7b6a8eea2e6c2092d7eea33228bbf6bf50fdf18'
4
+ data.tar.gz: 5ff1e4d2306b46b287abb76e8be11b727c38161740222ba9b14de2bb2a89a399
5
5
  SHA512:
6
- metadata.gz: 5017e8bd76814d2119faf4a9bd77924d034f7cacfd7496e92a6d8a6d882e124f079ba47cf5319579a252c5c9505ab329c93a97b543d2593c437311e166540429
7
- data.tar.gz: 44c779a4aeafce366b344231591a0c53bc9101e76116e25866656ffc8c31b0d936b2a545db0ff6b7a11f5c53d757e3c7779880bbaad9e9c69b97a91d5d47605a
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
 
@@ -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 script_args
186
- @script_args ||= tail_tags.split.map(&:inspect).join(' ')
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
- script = @script.inferer(script_name)
191
+ args = inferer_args
192
+ @inferer_cmd = args.shelljoin
191
193
 
192
- cmd = %(#{script} "#{@ticket}" "#{@description}" #{script_args})
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
@@ -23,6 +23,6 @@
23
23
  # correct subtitle of this documentation-block would be "and a Banner not named
24
24
  # Bruce."
25
25
  module Ptimelog
26
- VERSION = '0.13.0'
26
+ VERSION = '0.13.1'
27
27
  BANNER = 'Move time-entries from gTimelog or Obsidian to PuzzleTime'
28
28
  end
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.0
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-30 00:00:00.000000000 Z
11
+ date: 2026-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmdparse