ruby_todo 0.3.5 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e46315512bc270ba2bd10e0b43319e093f9e6aa1df35f884a2a84c70d8830da
4
- data.tar.gz: 9ba6df809f63ef4f91612aabe52c6678294d354aaadf6cba188dc0dab283116f
3
+ metadata.gz: a687c9f4bb0db9df671ccb741b37dc96ee9bef6e73c430d42d8de580f13a6969
4
+ data.tar.gz: 74a004b0794125b2ee2e9db9a17579b6695969e1d0d56c7bc76a21f71cb9f94a
5
5
  SHA512:
6
- metadata.gz: f012f3447c1cb5b63b4029bfb3389bdc2667b442cd34bc2a092eb095efe3fe99328f4313d5d0d0e0a9cbeedf7fe344cec90d5c71c2dd1cc87ff4e4abc1f7ad3f
7
- data.tar.gz: 0600e9b11b7cb92a01c7de4ead9d4ad0b465a9c864f9175eaaca17cfdc3ea13c251dadee54398a90364e493c881e720ab68403c7a16fe348dbff9712c27b789f
6
+ metadata.gz: e5801730249eec150ebc2a10439581852e313bd0ed1e7d3ce62c412a33e8568b3cb769c335a9a763e13f30bf87914485563210720015c01a44cfd60ffc7365bb
7
+ data.tar.gz: 5199b14e9005bcddd88e79fd2e0e3dbb0a506bdefb96582fc65c63fa8166b08cb4e895c3b644bf64e92871335dcd6bc30d2d7b62e56209a58d8d633a6e438773
data/CHANGELOG.md CHANGED
@@ -1,8 +1,19 @@
1
- ## [0.3.5] - 2025-03-28
1
+ ## [0.4.1] - 2025-03-28
2
2
 
3
3
  * Manual release
4
4
 
5
5
 
6
+ ## [0.4.0] - 2025-03-28
7
+
8
+ ### Added
9
+ - Restructured CLI commands for better organization
10
+ - Added dedicated NotebookCommand class for notebook-related commands
11
+ - Improved command structure consistency
12
+
13
+ ### Fixed
14
+ - Fixed `notebook` command not being recognized issue
15
+ - Ensured proper subcommand registration
16
+
6
17
  ## [0.3.4] - 2025-03-28
7
18
 
8
19
  * Manual release
data/lib/ruby_todo/cli.rb CHANGED
@@ -26,6 +26,30 @@ module RubyTodo
26
26
  true
27
27
  end
28
28
 
29
+ # Notebook commands
30
+ class NotebookCommand < Thor
31
+ desc "create NAME", "Create a new notebook"
32
+ def create(name)
33
+ Notebook.create(name: name)
34
+ puts "Created notebook: #{name}".green
35
+ end
36
+
37
+ desc "list", "List all notebooks"
38
+ def list
39
+ notebooks = Notebook.all
40
+ if notebooks.empty?
41
+ puts "No notebooks found. Create one with 'ruby_todo notebook create NAME'".yellow
42
+ return
43
+ end
44
+
45
+ table = TTY::Table.new(
46
+ header: ["ID", "Name", "Tasks", "Created At"],
47
+ rows: notebooks.map { |n| [n.id, n.name, n.tasks.count, n.created_at] }
48
+ )
49
+ puts table.render(:ascii)
50
+ end
51
+ end
52
+
29
53
  # Template commands
30
54
  class TemplateCommand < Thor
31
55
  desc "create NAME", "Create a new task template"
@@ -179,26 +203,12 @@ module RubyTodo
179
203
  say "Ruby Todo has been initialized successfully!".green
180
204
  end
181
205
 
182
- desc "notebook create [NAME]", "Create a new notebook"
183
- def create(name)
184
- Notebook.create(name: name)
185
- say "Created notebook: #{name}".green
186
- end
206
+ # Register subcommands
207
+ desc "notebook SUBCOMMAND", "Manage notebooks"
208
+ subcommand "notebook", NotebookCommand
187
209
 
188
- desc "notebook list", "List all notebooks"
189
- def list
190
- notebooks = Notebook.all
191
- if notebooks.empty?
192
- say "No notebooks found. Create one with 'ruby_todo notebook create [NAME]'".yellow
193
- return
194
- end
195
-
196
- table = TTY::Table.new(
197
- header: ["ID", "Name", "Tasks", "Created At"],
198
- rows: notebooks.map { |n| [n.id, n.name, n.tasks.count, n.created_at] }
199
- )
200
- puts table.render(:ascii)
201
- end
210
+ desc "template SUBCOMMAND", "Manage task templates"
211
+ subcommand "template", TemplateCommand
202
212
 
203
213
  desc "task add [NOTEBOOK] [TITLE]", "Add a new task to a notebook"
204
214
  method_option :description, type: :string, desc: "Task description"
@@ -569,9 +579,6 @@ module RubyTodo
569
579
  end
570
580
  end
571
581
 
572
- desc "template SUBCOMMAND", "Manage task templates"
573
- subcommand "template", TemplateCommand
574
-
575
582
  # Task-related command aliases
576
583
  map "task:list" => "task_list"
577
584
  map "task:show" => "task_show"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyTodo
4
- VERSION = "0.3.5"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_todo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremiah Parrack