time-sheet 0.11.0 → 0.13.0
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/lib/time_sheet/time/cmd.rb +7 -3
- data/lib/time_sheet/time/entry.rb +6 -2
- data/lib/time_sheet/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: f9adeab367eb0148cb4955998b48150ee01572c73bb10dae433f06c070522751
|
|
4
|
+
data.tar.gz: e0574ef0e9cd16b10bea3aed8de0aea289e7e9255211236a30e91ae49fef6b99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75e6ea96de075b554cf181d5298fb1527380d6aa3c7e0d982afe0e596849cd521b102add3d1f2e1ad2e45e0fef8ab76effb1815fc9ab8f03d2cc66c825dd0ca6
|
|
7
|
+
data.tar.gz: 441d49f696d8afc564ff6baf409895f33192c8dd232f4d34c9eb2d11e5fee6eb13d703feeb7f9971a0299fde5ebacfc64ee43d924ca4e77baa2ec07cebe2afac
|
data/lib/time_sheet/time/cmd.rb
CHANGED
|
@@ -117,7 +117,7 @@ class TimeSheet::Time::Cmd
|
|
|
117
117
|
o.string '-t', '--to', 'ignore entries more recent than the date given'
|
|
118
118
|
o.string '-p', '--project', 'take only entries of this project into account'
|
|
119
119
|
o.string '-a', '--activity', 'take only entries of this activity into account'
|
|
120
|
-
o.string '--tags', '
|
|
120
|
+
o.string '--tags', 'filter by tag (comma separated, not case sensitive, prefix tag with ! to exclude)'
|
|
121
121
|
o.string '-d', '--description', 'consider only entries matching this description'
|
|
122
122
|
o.string '-e', '--employee', 'consider only entries for this employee'
|
|
123
123
|
o.float '-r', '--rate', 'use an alternative hourly rate (default: 80.0)', default: 80.00
|
|
@@ -156,11 +156,15 @@ class TimeSheet::Time::Cmd
|
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
if options[:package]
|
|
159
|
-
package = data.last.map{|entry| entry[1]}.sum
|
|
159
|
+
package = (data.last.nil? ? 0 : data.last.map{|entry| entry[1]}.sum)
|
|
160
160
|
total = options[:package] * 60
|
|
161
161
|
percent = (package / total.to_f * 100)
|
|
162
162
|
|
|
163
|
-
puts
|
|
163
|
+
puts [
|
|
164
|
+
"current package: #{package}/#{total}",
|
|
165
|
+
"(#{(package / 60.0).round(2)}/#{(total / 60.0).round(2)} hours,",
|
|
166
|
+
"#{percent.round 2}%)"
|
|
167
|
+
].join(' ')
|
|
164
168
|
end
|
|
165
169
|
end
|
|
166
170
|
|
|
@@ -78,7 +78,6 @@ class TimeSheet::Time::Entry
|
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def tags
|
|
81
|
-
binding.pry if @data['tags'] == 86
|
|
82
81
|
self.class.parse_tags(@data['tags'])
|
|
83
82
|
end
|
|
84
83
|
|
|
@@ -106,7 +105,12 @@ class TimeSheet::Time::Entry
|
|
|
106
105
|
return true if tags.empty?
|
|
107
106
|
|
|
108
107
|
tags.all? do |tag|
|
|
109
|
-
|
|
108
|
+
if tag.match?(/^\!/)
|
|
109
|
+
t = tag.gsub(/\!/, '')
|
|
110
|
+
!self.tags.include?(t)
|
|
111
|
+
else
|
|
112
|
+
self.tags.include?(tag)
|
|
113
|
+
end
|
|
110
114
|
end
|
|
111
115
|
end
|
|
112
116
|
|
data/lib/time_sheet/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: time-sheet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Moritz Schepp
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: spreadsheet
|