lib/totrello.rb in totrello-0.2.02 vs lib/totrello.rb in totrello-0.2.03
- old
+ new
@@ -10,24 +10,14 @@
@trello
@directory
@config
def initialize(directory)
- begin
- @trello = TrelloCreator.new
- @directory = directory
- totrello_config = TotrelloConfig.new(directory)
- @config = totrello_config.build_hash
- rescue
- error_data = "It looks like you're missing some details:\n\n\n"
- error_data += " You must define TRELLO_DEVELOPER_PUBLIC_KEY & TRELLO_MEMBER_TOKEN\n"
- error_data += " \nYou can generate the TRELLO_DEVELOPER_PUBLIC_KEY at:\n"
- error_data += " \nhttps://trello.com/1/appKey/generate\n"
- error_data += " \nYou can generate the TRELLO_MEMBER_TOKEN at:\n "
- error_data += "\nhttps://trello.com/1/authorize?key=[TRELLO_DEVELOPER_PUBLIC_KEY]&name=ToTrelloGem&expiration=never&response_type=token&scope=read,write\n"
- puts error_data
- end
+ @trello = TrelloCreator.new
+ @directory = directory
+ totrello_config = TotrelloConfig.new(directory)
+ @config = totrello_config.build_hash
end
def find_todo_items
puts 'Generating your board'
@@ -54,10 +44,9 @@
def create_trello_card(board, list, todo, filename)
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"