lib/bullit/file.rb in bullit-0.1.1 vs lib/bullit/file.rb in bullit-0.1.2p1
- old
+ new
@@ -43,12 +43,10 @@
file[:tasks] = file[:tasks].reject{ |t| t[:complete] == true }
yesterday_file.write(YAML.dump(file))
- binding.pry
-
if file[:tasks] == {}
return nil
else
return file[:tasks]
end
@@ -60,10 +58,10 @@
end
def self.add_task(text)
file = YAML.load(today_file.read)
- if file[:tasks].nil?
+ if file[:tasks] == {}
file[:tasks] = [ Task.new(text: text).to_h ]
else
file[:tasks] = today_tasks << Task.new(text: text).to_h
end
\ No newline at end of file