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 +4 -4
- data/README.md +27 -18
- data/lib/generators/todoro/install_generator.rb +22 -0
- data/lib/generators/todoro/templates/add_indexes_to_todoro_tasks.rb +7 -0
- data/{db/migrate/20250214104111_create_todoro_reminders.rb → lib/generators/todoro/templates/create_todoro_reminders.rb} +1 -1
- data/{db/migrate/20250214104107_create_todoro_task_lists.rb → lib/generators/todoro/templates/create_todoro_task_lists.rb} +1 -1
- data/{db/migrate/20250214104109_create_todoro_tasks.rb → lib/generators/todoro/templates/create_todoro_tasks.rb} +1 -1
- data/lib/todoro/version.rb +1 -1
- metadata +11 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9df4d399bddcdec90b476afd3f277a388c9ed04a60c3388cbd339f33f9bc78a
|
|
4
|
+
data.tar.gz: 4d56a850c3674c38e6abeaae287afe234f6a6fee73edb09722b8d066f3a61095
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
4
|
+

|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Add to your Gemfile:
|
|
7
9
|
|
|
8
10
|
```ruby
|
|
9
|
-
|
|
10
|
-
acts_as_taskable
|
|
11
|
-
end
|
|
11
|
+
gem "todoro"
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
And then execute:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
task = project.add_task_to_list(task_list, "Build homepage", "Implement UI components")
|
|
17
|
+
$ bundle
|
|
18
|
+
```
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Or install it yourself as:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
$ gem install todoro
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
##
|
|
26
|
+
## Usage
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
Generate the required migrations
|
|
27
29
|
|
|
28
30
|
```ruby
|
|
29
|
-
|
|
31
|
+
rails generate todoro:install
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
Include Taskable in the model(s) that can have tasks
|
|
33
35
|
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
+
```ruby
|
|
37
|
+
class Project < ApplicationRecord
|
|
38
|
+
acts_as_taskable
|
|
39
|
+
end
|
|
36
40
|
```
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
Now, a Project can have task lists and tasks!
|
|
39
43
|
|
|
40
44
|
```bash
|
|
41
|
-
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class CreateTodoroReminders < ActiveRecord::Migration[
|
|
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 }
|
data/lib/todoro/version.rb
CHANGED
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.
|
|
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-
|
|
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:
|
|
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:
|
|
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
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
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
|