lib/totrello.rb in totrello-0.1.12 vs lib/totrello.rb in totrello-0.1.13
- old
+ new
@@ -33,16 +33,14 @@
puts "Woot! We've got'em"
puts 'Generating your board'
board_name = todos[:directory].nil? ? todos[:directory] : @directory.split('/').last
puts "Creating the board: #{board_name}"
- begin
- board = @trello.find_board(board_name)
- rescue
- board = @trello.create_board(board_name, 'Auto Generated by ToTrello Gem')
- end
+ board = @trello.find_board(board_name)
+ board ||= @trello.create_board(board_name, 'Auto Generated by ToTrello Gem')
- puts "Created or found a board with the ID: #{board}"
+ return -1 if board.nil?
+ puts "Created or found a board with the ID: #{board.name}"
puts 'Talking to Trello, this is the longest part...'
todos[:todo_list].each do |tdl|