lib/totrello.rb in totrello-0.1.1 vs lib/totrello.rb in totrello-0.1.2

- old
+ new

@@ -31,19 +31,26 @@ todo = ToDoFind.new todos = todo.search(@directory) puts "Woot! We've got'em" puts 'Generating your board' + begin + board = @trello.find_board(todos[:directory]) + rescue + board ||= @trello.create_board(todos[:directory], 'Auto Generated by ToTrello Gem') + end - @trello.create_board(todos[:directory], 'Auto Generated by ToTrello Gem') - board = @trello.find_board(todos[:directory]) - puts 'Taking to Trello, this is the longest part...' todos[:todo_list].each do |tdl| tdl[:todos].each do |td| - @trello.create_card(board,td, gen_description(tdl[:file],td),'To Do') unless td == '' + begin + @trello.create_card(board,td, gen_description(tdl[:file],td),'To Do') unless td == '' + rescue + puts 'error posting to trello' + end + end end puts "And you're ready to go!" end