Ubuntu Pastebin

Paste from a at Mon, 18 May 2015 13:57:55 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
            k = Trello::Organization.find('kubuntu')
p k
            b = []
            k.boards.each do |board|
                b << board unless board.closed
            end

            unless @registry.key?(:last_check)
                puts("trello : registry had no last_check value, skipping this run")
                b = []
            end
            since  = @registry[:last_check]
            before = Time.now.utc.to_s
            @registry[:last_check] = before
            puts("trello : since: #{since} -> before: #{before} || boards: #{b.size}")

            b.each do |board|
                board.actions({:filter => 'createCard,updateCard,commentCard',
                               :since => since,
                               :before => before}).each do |action|
                    p action
                    case action.type
                    when 'createCard'
                        card_create(action)
                    when 'updateCard'
                        card_update(action)
                    when 'commentCard'
                        card_comment(action)
                    when 'removeMemberFromCard', 'addMemberToCard', 'moveCardFromBoard', 'updateBoard', 'createBoard', 'addToOrganizationBoard', 'addChecklistToCard', 'updateChecklist', 'addMemberToBoard', 'makeAdminOfBoard', 'moveCardToBoard', 'createList', 'updateCheckItemStateOnCard', 'updateList', 'moveListToBoard', 'copyCommentCard', 'copyCard'
                        # skip
                    else
                        unhandle(action)
                    end
                end
            end
Download as text