todoro 0.1.1 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76cf9b41d271df208d75cc427a754bb874cf8389aae5f7048606535d3ba64b73
4
- data.tar.gz: a939d0a0f55e5f14d5d4e3d7d46a6a62181eb3eac142392325b8e41ddab4ce2a
3
+ metadata.gz: a9df4d399bddcdec90b476afd3f277a388c9ed04a60c3388cbd339f33f9bc78a
4
+ data.tar.gz: 4d56a850c3674c38e6abeaae287afe234f6a6fee73edb09722b8d066f3a61095
5
5
  SHA512:
6
- metadata.gz: 93d5d15baccc9d96b205db3a720e30d665ae2b83e870f2a4207c6c089956649a7e49b7a4608bdfa7f132bbe6d9dab3cc36cc18af2ec83d30f4f6668e5cd766a5
7
- data.tar.gz: fa39c6abad657cc54d48a4537abea35d868d1d6bfe8e347f9976d545d293ed6aa8b988894bf73c1c4df0cd8a17f4badce43a59fbe6b5c5f28573e45d666fd76c
6
+ metadata.gz: 4b9fd5d72efb5b3a6bb3b8b5c1b024405ab5f43b9f626607ce6ea2b740f8498abe14d045cd0c3d31256132ff80ab042664209985f48b02b72dbd07f0479f9890
7
+ data.tar.gz: c2d103b2d0b301652b364ceeecc0e65e057e6431c79386a52e54a8ba26d841988394683337ee09d4f9c8ee8c4395edbc70152f7597427fc2ca0e432695a8abe0
data/README.md CHANGED
@@ -1,45 +1,54 @@
1
1
  # Todoro
2
2
  A lightweight Rails engine that lets any model manage task lists and tasks with a simple, flexible API.
3
3
 
4
- ## Usage
4
+ ![Totoro](totoro.png)
5
5
 
6
- Include Taskable in the model(s) that can have tasks
6
+ ## Installation
7
+
8
+ Add to your Gemfile:
7
9
 
8
10
  ```ruby
9
- class Project < ApplicationRecord
10
- acts_as_taskable
11
- end
11
+ gem "todoro"
12
12
  ```
13
13
 
14
- Now, a Project can have task lists and tasks!
14
+ And then execute:
15
15
 
16
16
  ```bash
17
- project = Project.create(name: "Website Redesign")
18
- task_list = project.create_task_list("Development Tasks")
19
- task = project.add_task_to_list(task_list, "Build homepage", "Implement UI components")
17
+ $ bundle
18
+ ```
20
19
 
21
- puts project.tasks # Lists all tasks in all its task lists
20
+ Or install it yourself as:
21
+
22
+ ```bash
23
+ $ gem install todoro
22
24
  ```
23
25
 
24
- ## Installation
26
+ ## Usage
25
27
 
26
- Add to your Gemfile:
28
+ Generate the required migrations
27
29
 
28
30
  ```ruby
29
- gem "todoro"
31
+ rails generate todoro:install
30
32
  ```
31
33
 
32
- And then execute:
34
+ Include Taskable in the model(s) that can have tasks
33
35
 
34
- ```bash
35
- $ bundle
36
+ ```ruby
37
+ class Project < ApplicationRecord
38
+ acts_as_taskable
39
+ end
36
40
  ```
37
41
 
38
- Or install it yourself as:
42
+ Now, a Project can have task lists and tasks!
39
43
 
40
44
  ```bash
41
- $ gem install todoro
45
+ project = Project.create(name: "Website Redesign")
46
+ task_list = project.create_task_list("Development Tasks")
47
+ task = project.add_task_to_list(task_list, "Build homepage", "Implement UI components")
48
+
49
+ puts project.tasks # Lists all tasks in all its task lists
42
50
  ```
43
51
 
52
+
44
53
  ## License
45
54
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,22 @@
1
+ require "rails/generators"
2
+ require "rails/generators/active_record"
3
+
4
+ module Todoro
5
+ module Generators
6
+ class InstallGenerator < Rails::Generators::Base
7
+ include Rails::Generators::Migration
8
+ source_root File.expand_path("templates", __dir__)
9
+
10
+ def create_migrations
11
+ migration_template "create_todoro_task_lists.rb", "db/migrate/create_todoro_task_lists.rb"
12
+ migration_template "create_todoro_tasks.rb", "db/migrate/create_todoro_tasks.rb"
13
+ migration_template "create_todoro_reminders.rb", "db/migrate/create_todoro_reminders.rb"
14
+ migration_template "add_indexes_to_todoro_tasks.rb", "db/migrate/add_indexes_to_todoro_tasks.rb"
15
+ end
16
+
17
+ def self.next_migration_number(dirname)
18
+ ActiveRecord::Generators::Base.next_migration_number(dirname)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,7 @@
1
+ class AddIndexesToTodoroTasks < ActiveRecord::Migration[ActiveRecord::Migration.current_version]
2
+ def change
3
+ add_index :todoro_task_lists, [ :taskable_type, :taskable_id ]
4
+ add_index :todoro_tasks, :status
5
+ add_index :todoro_tasks, :expiry_date
6
+ end
7
+ end
@@ -1,4 +1,4 @@
1
- class CreateTodoroReminders < ActiveRecord::Migration[8.0]
1
+ class CreateTodoroReminders < ActiveRecord::Migration[ActiveRecord::Migration.current_version]
2
2
  def change
3
3
  create_table :todoro_reminders do |t|
4
4
  t.references :task, null: false, foreign_key: { to_table: :todoro_tasks }
@@ -1,4 +1,4 @@
1
- class CreateTodoroTaskLists < ActiveRecord::Migration[8.0]
1
+ class CreateTodoroTaskLists < ActiveRecord::Migration[ActiveRecord::Migration.current_version]
2
2
  def change
3
3
  create_table :todoro_task_lists do |t|
4
4
  t.string :name, null: false
@@ -1,4 +1,4 @@
1
- class CreateTodoroTasks < ActiveRecord::Migration[8.0]
1
+ class CreateTodoroTasks < ActiveRecord::Migration[ActiveRecord::Migration.current_version]
2
2
  def change
3
3
  create_table :todoro_tasks do |t|
4
4
  t.string :title
@@ -1,3 +1,3 @@
1
1
  module Todoro
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: todoro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Despo Pentara
8
8
  - Evangelos Giataganas
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-14 00:00:00.000000000 Z
11
+ date: 2025-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 8.0.1
19
+ version: 7.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 8.0.1
26
+ version: 7.2.1
27
27
  description: A lightweight Rails engine that lets any model manage task lists and
28
28
  tasks with a simple, flexible API.
29
29
  email:
@@ -60,9 +60,11 @@ files:
60
60
  - app/views/todoro/tasks/edit.html.erb
61
61
  - app/views/todoro/tasks/new.html.erb
62
62
  - config/routes.rb
63
- - db/migrate/20250214104107_create_todoro_task_lists.rb
64
- - db/migrate/20250214104109_create_todoro_tasks.rb
65
- - db/migrate/20250214104111_create_todoro_reminders.rb
63
+ - lib/generators/todoro/install_generator.rb
64
+ - lib/generators/todoro/templates/add_indexes_to_todoro_tasks.rb
65
+ - lib/generators/todoro/templates/create_todoro_reminders.rb
66
+ - lib/generators/todoro/templates/create_todoro_task_lists.rb
67
+ - lib/generators/todoro/templates/create_todoro_tasks.rb
66
68
  - lib/tasks/todoro_tasks.rake
67
69
  - lib/todoro.rb
68
70
  - lib/todoro/engine.rb