freshbooks-cli 0.3.1 → 0.3.3
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/fb/cli.rb +20 -1
- data/lib/fb/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e9f2e80e5c692c3e2f848dc206858d680c0061166e8a013b16e877830b70db1
|
|
4
|
+
data.tar.gz: 8e52c8bc022ee719e91b8d4b35848c497d0ef5e8795e3e980e90fd773add1b76
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 888e34a5ac7493d2b5ad9974094c90caf7f1151b711f717bc8ed41adf19c487cd446bbe5545e30cb7cddec9c16f60b2cbf9a6a38e7781f7b1921d47726e46542
|
|
7
|
+
data.tar.gz: 06ac47c6e320242bb088b90d8e55e3452e71ae72e5eb42fb0a69c8f1ca620e0564a10a5a2c0cd926c120b942db326511b75f57b4d2b8e26725f541ae20d33a7d
|
data/lib/fb/cli.rb
CHANGED
|
@@ -299,7 +299,7 @@ module FB
|
|
|
299
299
|
entries.sort_by! { |e| e["started_at"] || "" }
|
|
300
300
|
|
|
301
301
|
rows = entries.map do |e|
|
|
302
|
-
date = e["started_at"] || "?"
|
|
302
|
+
date = (e["local_started_at"] || e["started_at"] || "?").slice(0, 10)
|
|
303
303
|
client = maps[:clients][e["client_id"].to_s] || e["client_id"].to_s
|
|
304
304
|
project = maps[:projects][e["project_id"].to_s] || "-"
|
|
305
305
|
service = maps[:services][e["service_id"].to_s] || "-"
|
|
@@ -311,6 +311,25 @@ module FB
|
|
|
311
311
|
print_table(["ID", "Date", "Client", "Project", "Service", "Note", "Duration"], rows, wrap_col: 5)
|
|
312
312
|
|
|
313
313
|
total = entries.sum { |e| e["duration"].to_i } / 3600.0
|
|
314
|
+
|
|
315
|
+
# Per-client breakdown
|
|
316
|
+
by_client = entries.group_by { |e| maps[:clients][e["client_id"].to_s] || e["client_id"].to_s }
|
|
317
|
+
if by_client.length > 1
|
|
318
|
+
puts "\nBy client:"
|
|
319
|
+
by_client.sort_by { |_, es| -es.sum { |e| e["duration"].to_i } }.each do |name, es|
|
|
320
|
+
puts " #{name}: #{(es.sum { |e| e["duration"].to_i } / 3600.0).round(2)}h"
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Per-service breakdown
|
|
325
|
+
by_service = entries.group_by { |e| maps[:services][e["service_id"].to_s] || "-" }
|
|
326
|
+
if by_service.length > 1
|
|
327
|
+
puts "\nBy service:"
|
|
328
|
+
by_service.sort_by { |_, es| -es.sum { |e| e["duration"].to_i } }.each do |name, es|
|
|
329
|
+
puts " #{name}: #{(es.sum { |e| e["duration"].to_i } / 3600.0).round(2)}h"
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
|
|
314
333
|
puts "\nTotal: #{total.round(2)}h"
|
|
315
334
|
end
|
|
316
335
|
|
data/lib/fb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: freshbooks-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- parasquid
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-03-04 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: thor
|
|
@@ -107,6 +108,7 @@ licenses:
|
|
|
107
108
|
metadata:
|
|
108
109
|
source_code_uri: https://github.com/parasquid/freshbooks-cli
|
|
109
110
|
bug_tracker_uri: https://github.com/parasquid/freshbooks-cli/issues
|
|
111
|
+
post_install_message:
|
|
110
112
|
rdoc_options: []
|
|
111
113
|
require_paths:
|
|
112
114
|
- lib
|
|
@@ -121,7 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
121
123
|
- !ruby/object:Gem::Version
|
|
122
124
|
version: '0'
|
|
123
125
|
requirements: []
|
|
124
|
-
rubygems_version:
|
|
126
|
+
rubygems_version: 3.5.22
|
|
127
|
+
signing_key:
|
|
125
128
|
specification_version: 4
|
|
126
129
|
summary: FreshBooks time tracking CLI
|
|
127
130
|
test_files: []
|