gpuzzletime 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gpuzzletime/app.rb +11 -1
- data/lib/gpuzzletime/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: 770445fa339c64739dcfbff341b410757cf80b54c1340688f21bedf04ebf6ba3
|
4
|
+
data.tar.gz: d527556a32fd3e722caeaed3001b254d08cc2e77df05f9f91968efa5cd23d919
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2114fb4d188c30c11cbb260e6e64c501ba43352a5b26ca52248a76aa4e806eff62a53f34c7070860a2af1baa130569e6bbce9196204145a46b3eb1f33937e6fe
|
7
|
+
data.tar.gz: 22eabdb94e69f3813f6f43987beec3500ab1370ae36bb72048121b24acd0b7ea49a34fe88d380bf624d13f862c1b84c34f15e16a03be971f361518a7b5da1c43
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ small tooling to transfer timelog-entries from gtimelog's timelog.txt to the Puz
|
|
32
32
|
- [ ] with a dedicated cli?
|
33
33
|
- [ ] from a REST-Endpoint of PTime?
|
34
34
|
- [ ] automatically prefill billable
|
35
|
-
- [
|
35
|
+
- [x] from time-accounts
|
36
36
|
- [ ] from *-notation
|
37
37
|
- [ ] allow to have a list of "favourite" time-accounts
|
38
38
|
- [ ] select best-matching time-account according to tags, possibly limited to the favourites
|
data/lib/gpuzzletime/app.rb
CHANGED
@@ -116,13 +116,15 @@ module Gpuzzletime
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def url_options(start, entry)
|
119
|
+
account = infer_account(entry)
|
119
120
|
{
|
120
121
|
work_date: entry[:date],
|
121
122
|
'ordertime[ticket]': entry[:ticket],
|
122
123
|
'ordertime[description]': entry[:description],
|
123
124
|
'ordertime[from_start_time]': start,
|
124
125
|
'ordertime[to_end_time]': entry[:time],
|
125
|
-
'ordertime[account_id]':
|
126
|
+
'ordertime[account_id]': account,
|
127
|
+
'ordertime[billable]': infer_billable(account),
|
126
128
|
}
|
127
129
|
.map { |key, value| [key, ERB::Util.url_encode(value)].join('=') }
|
128
130
|
.join('&')
|
@@ -181,5 +183,13 @@ module Gpuzzletime
|
|
181
183
|
cmd = %(#{parser} "#{entry[:ticket]}" "#{entry[:description]}" #{tags.map(&:inspect).join(' ')})
|
182
184
|
`#{cmd}`.chomp # maybe only execute if parser is in correct dir?
|
183
185
|
end
|
186
|
+
|
187
|
+
def infer_billable(account)
|
188
|
+
script = Pathname.new('~/.config/gpuzzletime/billable').expand_path
|
189
|
+
|
190
|
+
return 1 unless script.exist?
|
191
|
+
|
192
|
+
`#{script} #{account}`.chomp == 'true' ? 1 : 0
|
193
|
+
end
|
184
194
|
end
|
185
195
|
end
|
data/lib/gpuzzletime/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpuzzletime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Viehweger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|