rubyfocus 0.5.2 → 0.5.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/lib/rubyfocus/items/task.rb +17 -5
- data/version.txt +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70297c5dac917c7b8a6f0c5341bddb4587456c4f
|
4
|
+
data.tar.gz: a99ec2c4d65a7c36ed70f022ea8229e7d4ccec35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7309cae4cbe610eb65f30ec46b6bef8359db5bcb76eb0023f4ab779f4d3ceec78fc3fe9ea8a2b1dc5035694660cb3504ff542b1ecad782680f4f7598c701775a
|
7
|
+
data.tar.gz: 637d8a4edd2f2531ebfe084e114ce7532554313e6bec4c9f0ea5d91b64f026a6fc5877b1ad3a63bdd85627afb0d828025d214aee7292891f0772b6871ec372d7
|
data/lib/rubyfocus/items/task.rb
CHANGED
@@ -66,7 +66,7 @@ class Rubyfocus::Task < Rubyfocus::RankedItem
|
|
66
66
|
|
67
67
|
# The first non-completed task, determined by order
|
68
68
|
def next_available_task
|
69
|
-
nat_candidate =
|
69
|
+
nat_candidate = next_available_immediate_task
|
70
70
|
if nat_candidate && nat_candidate.has_subtasks?
|
71
71
|
nat_candidate.next_available_task
|
72
72
|
else
|
@@ -74,23 +74,28 @@ class Rubyfocus::Task < Rubyfocus::RankedItem
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
+
# The first non-completed immediate child task
|
78
|
+
def next_available_immediate_task
|
79
|
+
immediate_tasks.select{ |t| !t.completed? }.sort_by(&:rank).first
|
80
|
+
end
|
81
|
+
|
77
82
|
# A list of all tasks that you can take action on. Actionable tasks
|
78
83
|
# are tasks that are:
|
79
84
|
# * not completed
|
80
85
|
# * not blocked (as part of a sequential project or task group)
|
81
86
|
# * not due to start in the future
|
82
87
|
def actionable_tasks
|
83
|
-
|
88
|
+
next_tasks.select{ |t| !t.deferred? }
|
84
89
|
end
|
85
90
|
|
86
91
|
# A list of all tasks that are not blocked.
|
87
92
|
def next_tasks
|
88
|
-
|
93
|
+
incomplete_tasks.select{ |t| !t.blocked? }
|
89
94
|
end
|
90
95
|
|
91
96
|
# A list of all tasks that aren't complete
|
92
97
|
def incomplete_tasks
|
93
|
-
|
98
|
+
tasks.select{ |t| !t.completed? }
|
94
99
|
end
|
95
100
|
|
96
101
|
# Are there any tasks on this project which aren't completed?
|
@@ -110,7 +115,14 @@ class Rubyfocus::Task < Rubyfocus::RankedItem
|
|
110
115
|
|
111
116
|
# Can we attack this task, or does its container stop that happening?
|
112
117
|
def blocked?
|
113
|
-
|
118
|
+
# Cannot be blocked without a container, or when inside a folder
|
119
|
+
return false if container.nil? || container.is_a?(Rubyfocus::Folder)
|
120
|
+
|
121
|
+
# If container is blocked, I must be blocked
|
122
|
+
return true if container.blocked?
|
123
|
+
|
124
|
+
# Otherwise, only blocked if the container is sequential and I'm not next
|
125
|
+
return (container.order == :sequential && container.next_available_immediate_task != self)
|
114
126
|
end
|
115
127
|
|
116
128
|
#---------------------------------------
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.3
|