xuuki-do-list 0.0.1 → 0.0.2
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/bin/xuuki-do-list +18 -8
- data/lib/xuuki-do-list/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: 0e88cd31b063664b3f9eef917b9da3443f6ca0f511dbf9928ac08fb075a826db
|
4
|
+
data.tar.gz: c36e56e2fb6baabee7fb856e3afad82007b113bb9627bc276a83098544e127f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11da4bf49507df0294196b513ea084fc8e167189a975271e2d6d962a2ed538c8694f07e5f304cfdb91c00a2bbb360523041bd55b6a6997438389b510026d417
|
7
|
+
data.tar.gz: db699dc8c423914778a0746fc4cb4844f25c7f4682bca572243ffbfe3043e1122d65dab8a4c8e972ef7ba1951c391c5540928546489073753b1ca1232fd4613d
|
data/bin/xuuki-do-list
CHANGED
@@ -69,15 +69,29 @@ class App
|
|
69
69
|
desc 'List tasks'
|
70
70
|
arg_name 'Describe arguments to list here'
|
71
71
|
command :list do |c|
|
72
|
+
c.desc 'Format of the output'
|
73
|
+
c.arg_name 'csv|pretty'
|
74
|
+
c.default_value 'pretty'
|
75
|
+
c.flag :format
|
76
|
+
|
72
77
|
c.action do |global_options, options, args|
|
78
|
+
|
73
79
|
File.open(TODO_FILE,'r') do |file|
|
74
80
|
counter = 1
|
81
|
+
|
75
82
|
file.readlines.each do |line|
|
76
83
|
name,created,completed = read_todo(line)
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
84
|
+
status = completed.nil? || completed.empty? ? "INCOMPLETE" : "DONE"
|
85
|
+
|
86
|
+
if options[:format] == 'pretty'
|
87
|
+
# Use the pretty-print format
|
88
|
+
printf("%3d - %s\n", counter, name)
|
89
|
+
printf(" Created : %s\n", created)
|
90
|
+
printf(" Status : %s\n", status)
|
91
|
+
printf(" Completed : %s\n", completed) unless completed.nil? || completed.empty?
|
92
|
+
elsif options[:format] == 'csv'
|
93
|
+
# Use the machine-readable CSV format
|
94
|
+
printf("%d,%s,%s,%s,%s\n", counter, name, status, created,completed)
|
81
95
|
end
|
82
96
|
counter += 1
|
83
97
|
end
|
@@ -113,10 +127,6 @@ class App
|
|
113
127
|
else
|
114
128
|
puts "No such file: #{TODO_FILE}"
|
115
129
|
end
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
130
|
end
|
121
131
|
end
|
122
132
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xuuki-do-list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Nash
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-22 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|