Решение на Втора задача от Моника Илиева

Обратно към всички решения

Към профила на Моника Илиева

Резултати

  • 0 точки от тестове
  • 0 бонус точки
  • 0 точки общо
  • 0 успешни тест(а)
  • 22 неуспешни тест(а)

Код

class Task
attr_accessor :status, :description, :priority, :tags
def initialize(status, description, priority, tags)
@status, @description, @priority = status, description, priority
@tags = tags
end
end
class TodoList
include Enumerable
attr_accessor :tasks
def self.parse(text)
tasks = text.lines.each_slice(4).map do |status,description,priority,tags|
Task.new(status, description, priority, tags)
end
new tasks
end
def each
@tasks.each { |task| yield task }
end
def tasks_todo
#
end
def tasks_in_progress
#
end
def tasks_completed
#
end
def completed?
#
end
def filter(criteria)
self.new @tasks.select { |task| criteria.meets? task }
end
def adjoin(other)
self.class.new tasks | other.tasks
end
end
class Criteria
class << self
def status(status)
Criterion.new { |task| task.status == status }
end
def priority(priority)
Criterion.new { |task| task.priority == priority }
end
def tags(tags)
Criterion.new { |task| task.tags == tags }
end
end
end
class Criterion
def initialize(&block)
@block = block
end
def meets?(task)
@block.(task)
end
def &(other)
Criteria.new { |task| self.meets?(task) and other.meets?(task) }
end
def |(other)
Criteria.new { |task| self.meets?(task) or other.meets?(task) }
end
def !
Criteria.new { |task| not meets?(task) }
end
end

Лог от изпълнението

FFFFFFFFFFFFFFFFFFFFFF

Failures:

  1) TodoList filters tasks by status
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:19:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  2) TodoList filters tasks by priority
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:26:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  3) TodoList filters tasks by tag
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  4) TodoList filters tasks by multiple tags
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  5) TodoList filtering by multiple tags matches only tasks with all the tags
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:47:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  6) TodoList supports a conjuction of filters
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:51:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  7) TodoList supports a disjunction of filters
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:56:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  8) TodoList supports a negation of filters
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:66:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  9) TodoList supports simple filters combination
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:76:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  10) TodoList supports complex filters combination
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:81:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  11) TodoList can be adjoined with another to-do list
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:97:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  12) TodoList constructs an object for each task
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:110:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  13) TodoList returns the number of the tasks todo
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:119:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  14) TodoList returns the number of the tasks in progress
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:123:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  15) TodoList returns the number of the completed tasks
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:127:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  16) TodoList checks if all tasks are completed
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:131:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  17) TodoList doesn't modify the to-do list when filtering
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:136:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  18) TodoList implements Enumerable
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:141:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  19) TodoList contains tasks with the neccessary interface
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:146:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  20) TodoList tasks have an array of tags
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:155:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  21) TodoList preserves the order of tasks
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:159:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

  22) TodoList creates a new object on filter
     Failure/Error: let(:todo_list) { TodoList.parse text_input }
     ArgumentError:
       wrong number of arguments (1 for 0)
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `initialize'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `new'
     # /tmp/d20131107-4393-79p34c/solution.rb:20:in `parse'
     # /tmp/d20131107-4393-79p34c/spec.rb:16:in `block (2 levels) in <top (required)>'
     # /tmp/d20131107-4393-79p34c/spec.rb:173:in `block (2 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
     # ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'

Finished in 0.03054 seconds
22 examples, 22 failures

Failed examples:

rspec /tmp/d20131107-4393-79p34c/spec.rb:18 # TodoList filters tasks by status
rspec /tmp/d20131107-4393-79p34c/spec.rb:25 # TodoList filters tasks by priority
rspec /tmp/d20131107-4393-79p34c/spec.rb:35 # TodoList filters tasks by tag
rspec /tmp/d20131107-4393-79p34c/spec.rb:39 # TodoList filters tasks by multiple tags
rspec /tmp/d20131107-4393-79p34c/spec.rb:46 # TodoList filtering by multiple tags matches only tasks with all the tags
rspec /tmp/d20131107-4393-79p34c/spec.rb:50 # TodoList supports a conjuction of filters
rspec /tmp/d20131107-4393-79p34c/spec.rb:55 # TodoList supports a disjunction of filters
rspec /tmp/d20131107-4393-79p34c/spec.rb:65 # TodoList supports a negation of filters
rspec /tmp/d20131107-4393-79p34c/spec.rb:75 # TodoList supports simple filters combination
rspec /tmp/d20131107-4393-79p34c/spec.rb:80 # TodoList supports complex filters combination
rspec /tmp/d20131107-4393-79p34c/spec.rb:96 # TodoList can be adjoined with another to-do list
rspec /tmp/d20131107-4393-79p34c/spec.rb:109 # TodoList constructs an object for each task
rspec /tmp/d20131107-4393-79p34c/spec.rb:118 # TodoList returns the number of the tasks todo
rspec /tmp/d20131107-4393-79p34c/spec.rb:122 # TodoList returns the number of the tasks in progress
rspec /tmp/d20131107-4393-79p34c/spec.rb:126 # TodoList returns the number of the completed tasks
rspec /tmp/d20131107-4393-79p34c/spec.rb:130 # TodoList checks if all tasks are completed
rspec /tmp/d20131107-4393-79p34c/spec.rb:135 # TodoList doesn't modify the to-do list when filtering
rspec /tmp/d20131107-4393-79p34c/spec.rb:140 # TodoList implements Enumerable
rspec /tmp/d20131107-4393-79p34c/spec.rb:145 # TodoList contains tasks with the neccessary interface
rspec /tmp/d20131107-4393-79p34c/spec.rb:154 # TodoList tasks have an array of tags
rspec /tmp/d20131107-4393-79p34c/spec.rb:158 # TodoList preserves the order of tasks
rspec /tmp/d20131107-4393-79p34c/spec.rb:172 # TodoList creates a new object on filter

История (1 версия и 0 коментара)

Моника обнови решението на 06.11.2013 16:50 (преди около 11 години)

+class Task
+ attr_accessor :status, :description, :priority, :tags
+
+ def initialize(status, description, priority, tags)
+ @status, @description, @priority = status, description, priority
+ @tags = tags
+ end
+
+end
+
+class TodoList
+ include Enumerable
+
+ attr_accessor :tasks
+
+ def self.parse(text)
+ tasks = text.lines.each_slice(4).map do |status,description,priority,tags|
+ Task.new(status, description, priority, tags)
+ end
+ new tasks
+ end
+
+ def each
+ @tasks.each { |task| yield task }
+ end
+
+ def tasks_todo
+ #
+ end
+
+ def tasks_in_progress
+ #
+ end
+
+ def tasks_completed
+ #
+ end
+
+ def completed?
+ #
+ end
+
+ def filter(criteria)
+ self.new @tasks.select { |task| criteria.meets? task }
+ end
+
+ def adjoin(other)
+ self.class.new tasks | other.tasks
+ end
+
+end
+
+class Criteria
+
+ class << self
+
+ def status(status)
+ Criterion.new { |task| task.status == status }
+ end
+
+ def priority(priority)
+ Criterion.new { |task| task.priority == priority }
+ end
+ def tags(tags)
+ Criterion.new { |task| task.tags == tags }
+ end
+
+ end
+
+end
+
+class Criterion
+
+ def initialize(&block)
+ @block = block
+ end
+
+ def meets?(task)
+ @block.(task)
+ end
+
+ def &(other)
+ Criteria.new { |task| self.meets?(task) and other.meets?(task) }
+ end
+
+ def |(other)
+ Criteria.new { |task| self.meets?(task) or other.meets?(task) }
+ end
+
+ def !
+ Criteria.new { |task| not meets?(task) }
+ end
+
+end