gpuzzletime 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/README.md +30 -4
- data/lib/gpuzzletime/app.rb +5 -5
- 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: 935f5538b2556b40511a14ed7dda6bd71e8eefea8563e2299c951d75cfdff557
|
4
|
+
data.tar.gz: 175ef482206038f801ac60ad1028609e5fc58521e5711bb69d371498da9e697b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3727f5e42db8cdbf1920797925779937cbc735d3be96ba0c17aa4b755eb314aca1b7749673c1a9875479b0cfb06c49daf3093923968acd41b714e5712d20565c
|
7
|
+
data.tar.gz: 4089b6b6966b68c7bc8c464ee029c5d4d9c84389a622dcbb6b936663c000fe49ec5c46a49dfa58c7c58637072513341b1ecae46085ae90044864c9996c46ca66
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -66,22 +66,48 @@ For reusability in a shell-history the following keywords are supported:
|
|
66
66
|
- today
|
67
67
|
- yesterday
|
68
68
|
- last
|
69
|
+
- all
|
69
70
|
|
70
|
-
If nothing is specified, the action is applied to
|
71
|
+
If nothing is specified, the action is applied to entries of the last day.
|
71
72
|
|
72
73
|
### Edit-Identifier
|
73
74
|
|
74
|
-
When the action is "edit", the next argument is treated as script that
|
75
|
+
When the action is "edit", the next argument is treated as script that should be edited.
|
75
76
|
|
76
77
|
If nothing is passed, the main timelog.txt is loaded.
|
77
78
|
|
78
79
|
Otherwise, a script to determine the time-account is loaded.
|
79
80
|
|
81
|
+
## Helper-Scripts
|
82
|
+
|
83
|
+
gpuzzletime can prefill the account-number and billable-state of an entry.
|
84
|
+
|
85
|
+
The tags are used to determine a script that helps infer the time-account.
|
86
|
+
These scripts should be located in ~/.config/gpuzzletime/parsers/ and be named
|
87
|
+
like the first tag used. The script gets the ticket, the description and all
|
88
|
+
remaining tags passed as arguments. The output of the script should only be the
|
89
|
+
ID of the time-account.
|
90
|
+
|
91
|
+
In order to infer the billable-state of an entry, a script
|
92
|
+
~/.config/gpuzzletime/billable is called. It only gets the previously infered
|
93
|
+
account-id as argument and is expected to output "true" or "false".
|
94
|
+
|
95
|
+
Since these script are called a lot, it is better to write them in a compiled
|
96
|
+
language. If you only like ruby, take a look at crystal. For such simple
|
97
|
+
scripts, the code is almost identical and "just" needs to be compiled.
|
98
|
+
|
80
99
|
## Development
|
81
100
|
|
82
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
101
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
102
|
+
`rake spec` to run the tests. You can also run `bin/console` for an interactive
|
103
|
+
prompt that will allow you to experiment. Run `bundle exec gpuzzletime` to use
|
104
|
+
the gem in this directory, ignoring other installed copies of this gem.
|
83
105
|
|
84
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To
|
106
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
107
|
+
release a new version, update the version number in `version.rb`, and then run
|
108
|
+
`bundle exec rake release`, which will create a git tag for the version, push
|
109
|
+
git commits and tags, and push the `.gem` file to
|
110
|
+
[rubygems.org](https://rubygems.org).
|
85
111
|
|
86
112
|
## Contributing
|
87
113
|
|
data/lib/gpuzzletime/app.rb
CHANGED
@@ -14,7 +14,7 @@ module Gpuzzletime
|
|
14
14
|
|
15
15
|
case @command
|
16
16
|
when :show, :upload
|
17
|
-
@date = named_dates(args[1]) || :all
|
17
|
+
@date = named_dates(args[1] || 'last') || :all
|
18
18
|
when :edit
|
19
19
|
@file = args[1]
|
20
20
|
else
|
@@ -132,10 +132,10 @@ module Gpuzzletime
|
|
132
132
|
|
133
133
|
def named_dates(date)
|
134
134
|
case date
|
135
|
-
when 'yesterday'
|
136
|
-
when 'today'
|
137
|
-
when 'last'
|
138
|
-
|
135
|
+
when 'yesterday' then Date.today.prev_day.to_s
|
136
|
+
when 'today' then Date.today.to_s
|
137
|
+
when 'last' then parse(read).to_h.keys.compact.sort[-2] || Date.today.prev_day.to_s
|
138
|
+
when /(\d{2}-){2}-\d{4}/ then date
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
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.3.
|
4
|
+
version: 0.3.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:
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|