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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 770445fa339c64739dcfbff341b410757cf80b54c1340688f21bedf04ebf6ba3
4
- data.tar.gz: d527556a32fd3e722caeaed3001b254d08cc2e77df05f9f91968efa5cd23d919
3
+ metadata.gz: 935f5538b2556b40511a14ed7dda6bd71e8eefea8563e2299c951d75cfdff557
4
+ data.tar.gz: 175ef482206038f801ac60ad1028609e5fc58521e5711bb69d371498da9e697b
5
5
  SHA512:
6
- metadata.gz: 2114fb4d188c30c11cbb260e6e64c501ba43352a5b26ca52248a76aa4e806eff62a53f34c7070860a2af1baa130569e6bbce9196204145a46b3eb1f33937e6fe
7
- data.tar.gz: 22eabdb94e69f3813f6f43987beec3500ab1370ae36bb72048121b24acd0b7ea49a34fe88d380bf624d13f862c1b84c34f15e16a03be971f361518a7b5da1c43
6
+ metadata.gz: 3727f5e42db8cdbf1920797925779937cbc735d3be96ba0c17aa4b755eb314aca1b7749673c1a9875479b0cfb06c49daf3093923968acd41b714e5712d20565c
7
+ data.tar.gz: 4089b6b6966b68c7bc8c464ee029c5d4d9c84389a622dcbb6b936663c000fe49ec5c46a49dfa58c7c58637072513341b1ecae46085ae90044864c9996c46ca66
data/.rubocop.yml CHANGED
@@ -6,3 +6,7 @@ Style/TrailingCommaInArrayLiteral:
6
6
 
7
7
  Style/TrailingCommaInHashLiteral:
8
8
  EnforcedStyleForMultiline: consistent_comma
9
+
10
+ Metrics/BlockLength:
11
+ Exclude:
12
+ - spec/**/*
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 all entries.
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 shoudl be edited.
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 `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec gpuzzletime` to use the gem in this directory, ignoring other installed copies of this gem.
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 release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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
 
@@ -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' 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
- else date
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
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module Gpuzzletime
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
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.0
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: 2018-11-14 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler