Skip to content

Instantly share code, notes, and snippets.

@methyl
Created May 5, 2014 20:22
Show Gist options
  • Save methyl/11546527 to your computer and use it in GitHub Desktop.
Save methyl/11546527 to your computer and use it in GitHub Desktop.
rob.coffee
construtor: ->
@api = GRG.api
getCardsFromChecklists: ->
@api.getCardChecklists @, @convertChecklistToCards
convertTasksChecklistToCards: (checklists) =>
# use underscore.js bitch!
unless list = _(checklists).findWhere(name: GRG.Trello.Checklist.tasks.name)
console.log("Tasks checklist not found.")
return false
for item in list.checkItems when !(/^http/.test(item.name))
@api.postCard({name: item.name, listId: @listId()})
listId: =>
@_apiCard().idList()
_apiCard: =>
@_apiCard ?= @api.getCard @ #make meh sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment