lib/totrello.rb in totrello-0.2.01 vs lib/totrello.rb in totrello-0.2.02

- old
+ new

@@ -50,13 +50,24 @@ board = @trello.find_board(board_name) board ||= @trello.create_board(board_name, 'Auto Generated by ToTrello Gem') end def create_trello_card(board, list, todo, filename) - @trello.create_card(board, todo, gen_description(filename,todo, @config[:project_name].to_s),list) + description = gen_description(filename,todo, @config[:project_name].to_s) + card = @trello.create_card(board, todo[:todo], description ,list) end + #TODO: Test if this works + def gen_description(file, todo, project_name) + out = "TODO item found by the [ToTrello](https://rubygems.org/gems/totrello) gem\n" + out += "===========================\n" + out += "**Project name:** #{project_name}\n" + out += "**Filename**: #{file}\n" + out += "**Action item**: #{todo[:todo]}\n" + out += "**Location (at or near) line**: #{todo[:location]}\n" + end + private def create_cards(board) processes = [] @@ -65,11 +76,12 @@ puts 'Talking to Trello, this is the longest part...' todos[:todo_list].each do |tdl| tdl[:todos].each do |td| unless td == '' - processes.append(fork {create_trello_card(board, @config[:default_list].to_s, td, tdl[:file])}) + processes.append(fork {create_trello_card(board, @config[:default_list], td, tdl[:file])}) + end end end process_manager(processes) @@ -89,18 +101,9 @@ todos end - private - def gen_description(file, todo, project_name) - out = "TODO item found by ToTrello\n" - out += "===========================\n" - out += "**Project name:** #{project_name}\n" - out += "**Filename**: #{file}\n" - out += "**Action item**: #{todo[:todo]}\n" - out += "**Location (at or near) line**: #{todo[:location]}\n" - end end