todoro 0.1.2 → 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: 3484fe0d4b42818d6da75b14b1338263923ba16af50f7e004604f456a9793f89
4
- data.tar.gz: db0eb21bd21af52c31e146e1500990b6621bef2989d311f367c14d9b4cb83fac
3
+ metadata.gz: a9df4d399bddcdec90b476afd3f277a388c9ed04a60c3388cbd339f33f9bc78a
4
+ data.tar.gz: 4d56a850c3674c38e6abeaae287afe234f6a6fee73edb09722b8d066f3a61095
5
5
  SHA512:
6
- metadata.gz: 7bbcbdd4e9b607f5e1dadaa596e5ce1b712269762c481826823b46c564516e43eceaca8de23c186c3a28036b975966e79157df31c7550c47ac1a21de35c620a9
7
- data.tar.gz: eacfe1c557993e63efac5e8161cc8517b511627fbb2236fea10e7b7cf4e6c664bc4de12d907b9e7580be9931ca400c5adb7b0b322b58f1ab38e706b3488c53b5
6
+ metadata.gz: 4b9fd5d72efb5b3a6bb3b8b5c1b024405ab5f43b9f626607ce6ea2b740f8498abe14d045cd0c3d31256132ff80ab042664209985f48b02b72dbd07f0479f9890
7
+ data.tar.gz: c2d103b2d0b301652b364ceeecc0e65e057e6431c79386a52e54a8ba26d841988394683337ee09d4f9c8ee8c4395edbc70152f7597427fc2ca0e432695a8abe0
data/README.md CHANGED
@@ -3,45 +3,52 @@ A lightweight Rails engine that lets any model manage task lists and tasks with
3
3
 
4
4
  ![Totoro](totoro.png)
5
5
 
6
- ## Usage
6
+ ## Installation
7
7
 
8
- Include Taskable in the model(s) that can have tasks
8
+ Add to your Gemfile:
9
9
 
10
10
  ```ruby
11
- class Project < ApplicationRecord
12
- acts_as_taskable
13
- end
11
+ gem "todoro"
14
12
  ```
15
13
 
16
- Now, a Project can have task lists and tasks!
14
+ And then execute:
17
15
 
18
16
  ```bash
19
- project = Project.create(name: "Website Redesign")
20
- task_list = project.create_task_list("Development Tasks")
21
- task = project.add_task_to_list(task_list, "Build homepage", "Implement UI components")
17
+ $ bundle
18
+ ```
22
19
 
23
- puts project.tasks # Lists all tasks in all its task lists
20
+ Or install it yourself as:
21
+
22
+ ```bash
23
+ $ gem install todoro
24
24
  ```
25
25
 
26
- ## Installation
26
+ ## Usage
27
27
 
28
- Add to your Gemfile:
28
+ Generate the required migrations
29
29
 
30
30
  ```ruby
31
- gem "todoro"
31
+ rails generate todoro:install
32
32
  ```
33
33
 
34
- And then execute:
34
+ Include Taskable in the model(s) that can have tasks
35
35
 
36
- ```bash
37
- $ bundle
36
+ ```ruby
37
+ class Project < ApplicationRecord
38
+ acts_as_taskable
39
+ end
38
40
  ```
39
41
 
40
- Or install it yourself as:
42
+ Now, a Project can have task lists and tasks!
41
43
 
42
44
  ```bash
43
- $ 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
44
50
  ```
45
51
 
52
+
46
53
  ## License
47
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
@@ -1,4 +1,4 @@
1
- class AddIndexesToTodoroTasks < ActiveRecord::Migration[8.0]
1
+ class AddIndexesToTodoroTasks < ActiveRecord::Migration[ActiveRecord::Migration.current_version]
2
2
  def change
3
3
  add_index :todoro_task_lists, [ :taskable_type, :taskable_id ]
4
4
  add_index :todoro_tasks, :status
@@ -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.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: todoro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Despo Pentara
@@ -60,10 +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
66
- - db/migrate/20250215024110_add_indexes_to_todoro_tasks.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
67
68
  - lib/tasks/todoro_tasks.rake
68
69
  - lib/todoro.rb
69
70
  - lib/todoro/engine.rb