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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac9404e7d04991ef8dc948a191af024c71a04281
4
- data.tar.gz: 544d2f80833c2611419234b1107a9d4a11728b6d
3
+ metadata.gz: 70297c5dac917c7b8a6f0c5341bddb4587456c4f
4
+ data.tar.gz: a99ec2c4d65a7c36ed70f022ea8229e7d4ccec35
5
5
  SHA512:
6
- metadata.gz: 7cf6d7b4bcc3fd7c03f912b1b0968fe05c7c7e9641b6c114388a78e3dc90efb843258ac228370dde7ebb36219f3a3f998fbf8c4ed79a9483fe32a29058ab0e51
7
- data.tar.gz: 09372fae7605a9ace7694a646b23d3c54b5168dc08162c5971b5068f546fde08fc7c8d25dcf6217ededc07b49fb2a28137ba8136c6f86693a89f1a268ac65c51
6
+ metadata.gz: 7309cae4cbe610eb65f30ec46b6bef8359db5bcb76eb0023f4ab779f4d3ceec78fc3fe9ea8a2b1dc5035694660cb3504ff542b1ecad782680f4f7598c701775a
7
+ data.tar.gz: 637d8a4edd2f2531ebfe084e114ce7532554313e6bec4c9f0ea5d91b64f026a6fc5877b1ad3a63bdd85627afb0d828025d214aee7292891f0772b6871ec372d7
@@ -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 = immediate_tasks.select{ |t| !t.completed? }.sort_by(&:rank).first
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
- @actionable_tasks ||= next_tasks.select{ |t| !t.deferred? }
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
- @next_tasks ||= incomplete_tasks.select{ |t| !t.blocked? }
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
- @incomplete_tasks ||= tasks.select{ |t| !t.completed? }
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
- container && (container.order == :sequential) && (container.next_available_task != self)
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.2
1
+ 0.5.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyfocus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan-Yves Ruzicka