tacokit 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/Gemfile +3 -3
  4. data/README.md +62 -22
  5. data/lib/tacokit/authorization.rb +1 -1
  6. data/lib/tacokit/client/actions.rb +11 -11
  7. data/lib/tacokit/client/boards.rb +13 -13
  8. data/lib/tacokit/client/cards.rb +41 -40
  9. data/lib/tacokit/client/checklists.rb +10 -10
  10. data/lib/tacokit/client/labels.rb +4 -4
  11. data/lib/tacokit/client/lists.rb +8 -8
  12. data/lib/tacokit/client/members.rb +8 -8
  13. data/lib/tacokit/client/notifications.rb +2 -6
  14. data/lib/tacokit/client/organizations.rb +19 -47
  15. data/lib/tacokit/client/searches.rb +2 -0
  16. data/lib/tacokit/client/tokens.rb +12 -16
  17. data/lib/tacokit/client/types.rb +3 -1
  18. data/lib/tacokit/client/webhooks.rb +9 -14
  19. data/lib/tacokit/client.rb +2 -2
  20. data/lib/tacokit/collection.rb +4 -1
  21. data/lib/tacokit/configuration.rb +1 -1
  22. data/lib/tacokit/error.rb +3 -0
  23. data/lib/tacokit/middleware/{boom.rb → raise_error.rb} +3 -1
  24. data/lib/tacokit/middleware.rb +2 -2
  25. data/lib/tacokit/version.rb +1 -1
  26. data/spec/cassettes/Tacokit_Client/_connection/authorized_GET_request_with_app_key_and_token_params.json +1 -1
  27. data/spec/cassettes/Tacokit_Client_Actions/_action/returns_a_token_authorized_action.json +1 -1
  28. data/spec/cassettes/Tacokit_Client_Actions/_action/returns_oauth_authorized_board.json +1 -1
  29. data/spec/cassettes/Tacokit_Client_Actions/_action_board/returns_action_board.json +1 -1
  30. data/spec/cassettes/Tacokit_Client_Actions/_action_card/returns_action_card.json +1 -1
  31. data/spec/cassettes/Tacokit_Client_Actions/_action_entities/returns_action_entities.json +1 -1
  32. data/spec/cassettes/Tacokit_Client_Actions/_action_list/returns_action_list.json +1 -1
  33. data/spec/cassettes/Tacokit_Client_Actions/_delete_action/deletes_an_action.json +1 -1
  34. data/spec/cassettes/Tacokit_Client_Actions/_update_action/updates_an_action.json +1 -1
  35. data/spec/cassettes/Tacokit_Client_Actions/_update_action_text/updates_an_action.json +1 -1
  36. data/spec/cassettes/Tacokit_Client_Boards/_add_board_member/adds_invites_member_to_board.json +1 -1
  37. data/spec/cassettes/Tacokit_Client_Boards/_board/returns_a_token_authorized_board.json +1 -1
  38. data/spec/cassettes/Tacokit_Client_Boards/_board/returns_oauth_authorized_board.json +1 -1
  39. data/spec/cassettes/Tacokit_Client_Boards/_board_actions/returns_board_actions.json +1 -1
  40. data/spec/cassettes/Tacokit_Client_Boards/_board_cards/returns_board_cards.json +1 -1
  41. data/spec/cassettes/Tacokit_Client_Boards/_board_checklists/returns_board_checklists.json +1 -1
  42. data/spec/cassettes/Tacokit_Client_Boards/_board_labels/returns_board_labels.json +1 -1
  43. data/spec/cassettes/Tacokit_Client_Boards/_board_lists/returns_board_lists.json +1 -1
  44. data/spec/cassettes/Tacokit_Client_Boards/_board_members/returns_board_members.json +1 -1
  45. data/spec/cassettes/Tacokit_Client_Boards/_board_organization/returns_board_organization.json +1 -1
  46. data/spec/cassettes/Tacokit_Client_Boards/_board_preferences/returns_preferences_for_a_board.json +1 -1
  47. data/spec/cassettes/Tacokit_Client_Boards/_board_stars/returns_board_stars.json +1 -1
  48. data/spec/cassettes/Tacokit_Client_Boards/_update_board/updates_a_board.json +1 -1
  49. data/spec/cassettes/Tacokit_Client_Boards/_update_board/updates_nested_resource.json +1 -1
  50. data/spec/cassettes/Tacokit_Client_Boards/_update_board_member/updates_member.json +1 -1
  51. data/spec/cassettes/Tacokit_Client_Cards/_add_comment/creates_a_comment.json +1 -1
  52. data/spec/cassettes/Tacokit_Client_Cards/_add_label/adds_label_to_card.json +1 -1
  53. data/spec/cassettes/Tacokit_Client_Cards/_add_member_to_card/adds_member_to_card.json +1 -1
  54. data/spec/cassettes/Tacokit_Client_Cards/_archive_card/archives_card.json +1 -1
  55. data/spec/cassettes/Tacokit_Client_Cards/_archive_card/restore_card.json +1 -1
  56. data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_an_attachment.json +1 -1
  57. data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachments.json +1 -1
  58. data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_card_resource.json +1 -1
  59. data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_id.json +1 -1
  60. data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_short_link.json +1 -1
  61. data/spec/cassettes/Tacokit_Client_Cards/_card_actions/returns_card_actions.json +1 -1
  62. data/spec/cassettes/Tacokit_Client_Cards/_card_board/returns_card_board.json +1 -1
  63. data/spec/cassettes/Tacokit_Client_Cards/_card_list/returns_a_list.json +1 -1
  64. data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members.json +1 -1
  65. data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members_voted.json +1 -1
  66. data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_check_item_states.json +1 -1
  67. data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_checklists.json +1 -1
  68. data/spec/cassettes/Tacokit_Client_Cards/_create_card/creates_a_card.json +1 -1
  69. data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/attaches_external_url.json +1 -1
  70. data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/uploads_local_file.json +1 -1
  71. data/spec/cassettes/Tacokit_Client_Cards/_delete_card/deletes_a_card.json +1 -1
  72. data/spec/cassettes/Tacokit_Client_Cards/_delete_comment/deletes_comment.json +1 -1
  73. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_a_new_position.json +1 -1
  74. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_another_board_list.json +1 -1
  75. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_board.json +1 -1
  76. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_list.json +1 -1
  77. data/spec/cassettes/Tacokit_Client_Cards/_move_card/raises_error_if_missing_options.json +1 -1
  78. data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_new_checklist_by_name.json +1 -1
  79. data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/copies_a_checklist_by_id.json +1 -1
  80. data/spec/cassettes/Tacokit_Client_Cards/_stickers/returns_stickers.json +1 -1
  81. data/spec/cassettes/Tacokit_Client_Cards/_update_card/updates_a_card.json +1 -1
  82. data/spec/cassettes/Tacokit_Client_Cards/_update_checklist_item/updates_checklist_item.json +1 -1
  83. data/spec/cassettes/Tacokit_Client_Cards/_update_comment/updates_a_comment.json +1 -1
  84. data/spec/cassettes/Tacokit_Client_Cards/_vote/adds_a_member_s_vote_to_card.json +1 -1
  85. data/spec/cassettes/Tacokit_Client_Checklists/_check_items/adds_a_checklist_check_item.json +1 -1
  86. data/spec/cassettes/Tacokit_Client_Checklists/_check_items/retrieves_checklist_check_items.json +1 -1
  87. data/spec/cassettes/Tacokit_Client_Checklists/_checklist/returns_a_checklist_by_id.json +1 -1
  88. data/spec/cassettes/Tacokit_Client_Checklists/_create_checklist/creates_a_checklist.json +1 -1
  89. data/spec/cassettes/Tacokit_Client_Checklists/_delete_checklist/deletes_a_checklist.json +1 -1
  90. data/spec/cassettes/Tacokit_Client_Checklists/_update_checklist/updates_a_checklist.json +1 -1
  91. data/spec/cassettes/Tacokit_Client_Labels/_create_label/creates_a_label.json +1 -1
  92. data/spec/cassettes/Tacokit_Client_Labels/_delete_label/deletes_a_label.json +1 -1
  93. data/spec/cassettes/Tacokit_Client_Labels/_label/returns_a_label_by_id.json +1 -1
  94. data/spec/cassettes/Tacokit_Client_Labels/_update_label/updates_a_label.json +1 -1
  95. data/spec/cassettes/Tacokit_Client_Lists/_archive_list_cards/should_archive_cards_in_list.json +1 -1
  96. data/spec/cassettes/Tacokit_Client_Lists/_create_list/creates_a_list.json +1 -1
  97. data/spec/cassettes/Tacokit_Client_Lists/_list/returns_a_list_by_id.json +1 -1
  98. data/spec/cassettes/Tacokit_Client_Lists/_list_actions/returns_list_actions.json +1 -1
  99. data/spec/cassettes/Tacokit_Client_Lists/_list_board/returns_list_board.json +1 -1
  100. data/spec/cassettes/Tacokit_Client_Lists/_list_cards/returns_list_cards.json +1 -1
  101. data/spec/cassettes/Tacokit_Client_Lists/_move_list_cards/should_move_cards_in_list.json +1 -1
  102. data/spec/cassettes/Tacokit_Client_Lists/_update_list/updates_a_list.json +1 -1
  103. data/spec/cassettes/Tacokit_Client_Members/_actions/returns_member_actions.json +1 -1
  104. data/spec/cassettes/Tacokit_Client_Members/_boards/returns_for_me_with_options_as_first_arg.json +1 -1
  105. data/spec/cassettes/Tacokit_Client_Members/_boards/returns_member_boards.json +1 -1
  106. data/spec/cassettes/Tacokit_Client_Members/_cards/returns_member_cards.json +1 -1
  107. data/spec/cassettes/Tacokit_Client_Members/_member/accepts_a_resource.json +1 -1
  108. data/spec/cassettes/Tacokit_Client_Members/_member/authenticated/returns_self.json +1 -1
  109. data/spec/cassettes/Tacokit_Client_Members/_member/returns_a_member.json +1 -1
  110. data/spec/cassettes/Tacokit_Client_Members/_member/returns_self.json +1 -1
  111. data/spec/cassettes/Tacokit_Client_Members/_member/supports_query_fields_as_string_or_array.json +1 -1
  112. data/spec/cassettes/Tacokit_Client_Members/_notifications/returns_member_notifications.json +1 -1
  113. data/spec/cassettes/Tacokit_Client_Members/_organizations/returns_member_organizations.json +1 -1
  114. data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_tokens.json +1 -1
  115. data/spec/cassettes/Tacokit_Client_Members/_update_member/updates_a_member.json +1 -1
  116. data/spec/cassettes/Tacokit_Client_Members/_update_member/updates_nested_resource.json +1 -1
  117. data/spec/cassettes/Tacokit_Client_Notifications/_notification/returns_a_notification_by_id.json +1 -1
  118. data/spec/cassettes/Tacokit_Client_Notifications/_update_notification/updates_a_notification.json +1 -1
  119. data/spec/cassettes/Tacokit_Client_Organizations/_create_organization/creates_a_organization.json +1 -1
  120. data/spec/cassettes/Tacokit_Client_Organizations/_delete_organization/deletes_a_organization.json +1 -1
  121. data/spec/cassettes/Tacokit_Client_Organizations/_organization/returns_an_organization_by_id.json +1 -1
  122. data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_actions.json +1 -1
  123. data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_boards.json +1 -1
  124. data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_members.json +1 -1
  125. data/spec/cassettes/Tacokit_Client_Organizations/_update_organization/updates_a_organization.json +1 -1
  126. data/spec/cassettes/Tacokit_Client_Searches/_search/returns_search_result.json +1 -1
  127. data/spec/cassettes/Tacokit_Client_Tokens/_delete_token/deletes_a_token.json +1 -1
  128. data/spec/cassettes/Tacokit_Client_Tokens/_token/returns_a_token_for_token_string.json +1 -1
  129. data/spec/cassettes/Tacokit_Client_Tokens/_token_resource/returns_token_member.json +1 -1
  130. data/spec/cassettes/Tacokit_Client_Tokens/_token_resource/returns_token_webhooks.json +1 -1
  131. data/spec/cassettes/Tacokit_Client_Types/_type/returns_a_type_by_id.json +1 -1
  132. data/spec/cassettes/Tacokit_Client_Webhooks/_create_webhook/creates_a_webhook.json +1 -1
  133. data/spec/cassettes/Tacokit_Client_Webhooks/_delete_webhook/deletes_a_webhook.json +1 -1
  134. data/spec/cassettes/Tacokit_Client_Webhooks/_update_webhook/updates_a_webhook.json +1 -1
  135. data/spec/cassettes/Tacokit_Client_Webhooks/_webhook/returns_a_webhook_by_short_link.json +1 -1
  136. data/spec/spec_helper.rb +3 -4
  137. data/spec/tacokit/client/actions_spec.rb +1 -1
  138. data/spec/tacokit/client/boards_spec.rb +5 -5
  139. data/spec/tacokit/client/cards_spec.rb +3 -3
  140. data/spec/tacokit/client/checklists_spec.rb +1 -1
  141. data/spec/tacokit/client/lists_spec.rb +5 -2
  142. data/spec/tacokit/client/members_spec.rb +1 -1
  143. data/spec/tacokit/client/notifications_spec.rb +3 -2
  144. data/spec/tacokit/client/webhooks_spec.rb +14 -15
  145. data/spec/tacokit/client_spec.rb +1 -1
  146. data/spec/tacokit/middleware/{boom_spec.rb → raise_error_spec.rb} +1 -1
  147. data/tacokit.gemspec +1 -0
  148. metadata +19 -132
  149. data/spec/cassettes/Tacokit_Client_Actions/_action_field/returns_a_hash.json +0 -1
  150. data/spec/cassettes/Tacokit_Client_Actions/_action_field/returns_a_resource.json +0 -1
  151. data/spec/cassettes/Tacokit_Client_Actions/_action_field/returns_a_value.json +0 -1
  152. data/spec/cassettes/Tacokit_Client_Actions/_action_resource/returns_action_board.json +0 -1
  153. data/spec/cassettes/Tacokit_Client_Actions/_action_resource/returns_action_entities.json +0 -1
  154. data/spec/cassettes/Tacokit_Client_Actions/_action_resource/returns_action_memberships.json +0 -1
  155. data/spec/cassettes/Tacokit_Client_Actions/_update_action/updates_a_action.json +0 -1
  156. data/spec/cassettes/Tacokit_Client_Boards/_board_field/returns_a_hash.json +0 -1
  157. data/spec/cassettes/Tacokit_Client_Boards/_board_field/returns_a_value.json +0 -1
  158. data/spec/cassettes/Tacokit_Client_Boards/_board_field/returns_an_array.json +0 -1
  159. data/spec/cassettes/Tacokit_Client_Boards/_board_resource/returns_board_actions.json +0 -1
  160. data/spec/cassettes/Tacokit_Client_Boards/_board_resource/returns_board_cards.json +0 -1
  161. data/spec/cassettes/Tacokit_Client_Boards/_board_resource/returns_board_members.json +0 -1
  162. data/spec/cassettes/Tacokit_Client_Boards/_create_board/creates_a_board.json +0 -1
  163. data/spec/cassettes/Tacokit_Client_Boards/_create_board_resource/creates_a_board_calendar_key.json +0 -1
  164. data/spec/cassettes/Tacokit_Client_Boards/_create_board_resource/creates_a_board_label.json +0 -1
  165. data/spec/cassettes/Tacokit_Client_Boards/_create_board_resource/creates_a_board_resource.json +0 -1
  166. data/spec/cassettes/Tacokit_Client_Boards/_member_board_stars/returns_board_stars.json +0 -1
  167. data/spec/cassettes/Tacokit_Client_Boards/_update_board_field/updates_a_board_field.json +0 -1
  168. data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachment.json +0 -1
  169. data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_a_hash.json +0 -1
  170. data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_a_value.json +0 -1
  171. data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_an_array.json +0 -1
  172. data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_actions.json +0 -1
  173. data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_board.json +0 -1
  174. data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_check_item_states.json +0 -1
  175. data/spec/cassettes/Tacokit_Client_Cards/_card_stickers/returns_.json +0 -1
  176. data/spec/cassettes/Tacokit_Client_Cards/_create_card_comment/creates_a_comment.json +0 -1
  177. data/spec/cassettes/Tacokit_Client_Cards/_delete_card_resource/deletes_resource.json +0 -1
  178. data/spec/cassettes/Tacokit_Client_Cards/_list/returns_list.json +0 -1
  179. data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_a_checklist_item.json +0 -1
  180. data/spec/cassettes/Tacokit_Client_Checklists/_checklist_field/returns_a_value.json +0 -1
  181. data/spec/cassettes/Tacokit_Client_Checklists/_checklist_resource/returns_checklist_actions.json +0 -1
  182. data/spec/cassettes/Tacokit_Client_Checklists/_checklist_resource/returns_checklist_board.json +0 -1
  183. data/spec/cassettes/Tacokit_Client_Checklists/_checklist_resource/returns_checklist_prefs.json +0 -1
  184. data/spec/cassettes/Tacokit_Client_Labels/_label_resource/returns_a_board.json +0 -1
  185. data/spec/cassettes/Tacokit_Client_Labels/_labels/returns_a_label_by_id.json +0 -1
  186. data/spec/cassettes/Tacokit_Client_Lists/_list_field/returns_a_value.json +0 -1
  187. data/spec/cassettes/Tacokit_Client_Lists/_list_resource/returns_list_actions.json +0 -1
  188. data/spec/cassettes/Tacokit_Client_Lists/_list_resource/returns_list_board.json +0 -1
  189. data/spec/cassettes/Tacokit_Client_Lists/_list_resource/returns_list_cards.json +0 -1
  190. data/spec/cassettes/Tacokit_Client_Members/_board_stars/returns_member_board_stars.json +0 -1
  191. data/spec/cassettes/Tacokit_Client_Members/_member_field/returns_a_hash.json +0 -1
  192. data/spec/cassettes/Tacokit_Client_Members/_member_field/returns_a_member_field.json +0 -1
  193. data/spec/cassettes/Tacokit_Client_Members/_member_field/returns_a_resource.json +0 -1
  194. data/spec/cassettes/Tacokit_Client_Members/_member_field/returns_a_value.json +0 -1
  195. data/spec/cassettes/Tacokit_Client_Members/_member_field/returns_an_array.json +0 -1
  196. data/spec/cassettes/Tacokit_Client_Members/_member_resource/returns_member_actions.json +0 -1
  197. data/spec/cassettes/Tacokit_Client_Members/_member_resource/returns_member_board_stars.json +0 -1
  198. data/spec/cassettes/Tacokit_Client_Members/_member_resource/returns_member_boards.json +0 -1
  199. data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_organizations.json +0 -1
  200. data/spec/cassettes/Tacokit_Client_Notifications/_notification_field/returns_a_hash.json +0 -1
  201. data/spec/cassettes/Tacokit_Client_Notifications/_notification_field/returns_a_resource.json +0 -1
  202. data/spec/cassettes/Tacokit_Client_Notifications/_notification_field/returns_a_value.json +0 -1
  203. data/spec/cassettes/Tacokit_Client_Notifications/_notification_resource/returns_action_entities.json +0 -1
  204. data/spec/cassettes/Tacokit_Client_Notifications/_notification_resource/returns_notification_board.json +0 -1
  205. data/spec/cassettes/Tacokit_Client_Organizations/_organization_field/returns_a_hash.json +0 -1
  206. data/spec/cassettes/Tacokit_Client_Organizations/_organization_field/returns_a_resource.json +0 -1
  207. data/spec/cassettes/Tacokit_Client_Organizations/_organization_field/returns_a_value.json +0 -1
  208. data/spec/cassettes/Tacokit_Client_Organizations/_organization_field/returns_an_array.json +0 -1
  209. data/spec/cassettes/Tacokit_Client_Tokens/_token_field/returns_a_value.json +0 -1
  210. data/spec/cassettes/Tacokit_Client_Tokens/_token_field/returns_an_array.json +0 -1
  211. data/spec/cassettes/Tacokit_Client_Webhooks/_webhook_field/returns_a_value.json +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 721bdb7f3d850839c9e9dc12ccdba8452f03ca72
4
- data.tar.gz: a1da08c3defaa5806675b86795b11613d97bfbc0
3
+ metadata.gz: 893e6fcc338a5577d85ae6aeab7d2abd37aba994
4
+ data.tar.gz: 31289e149b682205ca77126dd117ba03ec0fcc52
5
5
  SHA512:
6
- metadata.gz: 4b4d275d708a8ab1694183e25370252710c3e23aec78c80d30f40429f3926b242fb138f6a79ad4e7ddd61ea71c1f688026f334b436784339975d131f2f45fab5
7
- data.tar.gz: bdc5d9afbb8b9917237a33b3197f3d3800e9a75b94afa99bd90b2e400a25587eb80d515f3dcc4f54a74dbaec8970f0b48e9a81c6793c6e332d766684daae635c
6
+ metadata.gz: 7daa990bf2a35abd1f69d58be4250023c1ed4b4f042ce6b23e4d162faa7e51f7e4f09c51adde90cd0de9ee60e79802d0c596b1a3656616ce7f23a858631a4bfa
7
+ data.tar.gz: 5d52cafaf8d20fd5602fe41015c75112776c98322a7bec1380389bad48c39368b03d5b5dc64812b69b734a8aeca9948431ab005d344ed124d031fab97867a23b
data/.rubocop.yml CHANGED
@@ -28,6 +28,9 @@ Metrics/AbcSize:
28
28
  Metrics/CyclomaticComplexity:
29
29
  Enabled: false
30
30
 
31
+ Metrics/ModuleLength:
32
+ Enabled: false
33
+
31
34
  Metrics/PerceivedComplexity:
32
35
  Enabled: false
33
36
 
data/Gemfile CHANGED
@@ -2,7 +2,6 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem "addressable"
6
5
  gem "awesome_print", require: "ap"
7
6
  gem "coveralls", require: false
8
7
  gem "dotenv"
@@ -13,8 +12,9 @@ gem "pry"
13
12
  gem "pry-byebug", platforms: :ruby_21
14
13
  gem "rake"
15
14
  gem "rb-fsevent"
16
- gem "rspec"
17
- gem "rubocop"
15
+ gem "rspec", "~> 3.3"
16
+ gem "rubocop", "~> 0.34"
18
17
  gem "sinatra"
19
18
  gem "vcr"
20
19
  gem "webmock"
20
+ gem "multi_json"
data/README.md CHANGED
@@ -100,15 +100,19 @@ behalf of different members:
100
100
  client = Tacokit::Client.new app_key: "4ppk3y", oauth_token: "04utht0k3n"
101
101
  ```
102
102
 
103
+ #### OAuth Tacokit Sandbox
104
+
103
105
  To experiment with OAuth tokens for development, visit the [Tacokit
104
- Sandbox](https://tacokit.herokuapp.com) and enter your Trello app key and app secret.
106
+ Sandbox](https://tacokit.herokuapp.com) and enter your Trello app key and app secret.
107
+
108
+ The sandbox (hosted over SSL on heroku) will perform the OAuth handshake and display OAuth credentials onscreen. In a real web app, you'd more likely associate these credentials with users in your database. Check out the source code for the sandbox on the [sandbox branch of this repository](https://github.com/rossta/tacokit.rb/tree/sandbox).
105
109
 
106
110
  #### Resources
107
111
 
108
112
  For more information on setting up Trello OAuth for your web application
109
113
 
110
114
  * Using OmniAuth? Try adding [omniauth-trello](https://github.com/joshrowley/omniauth-trello)
111
- * To roll your own, see how the sandbox works: [Tacokit sandbox source](https://github.com/rossta/tacokit.rb/blob/heroku/app.rb)
115
+ * To roll your own, see how the sandbox works: [Tacokit sandbox source](https://github.com/rossta/tacokit.rb/blob/817691cbc6933e5bf2fac23d37e57cf7fdbbdf04/app.rb)
112
116
  * Check out the [Trello OAuth docs](https://trello.com/docs/gettingstarted/oauth.html)
113
117
 
114
118
  ### Using ENV variables
@@ -123,50 +127,86 @@ TRELLO_APP_TOKEN=4ppt0k3n
123
127
 
124
128
  ## Usage
125
129
 
126
- Working with boards
130
+ All requests are called on instances of a `Tacokit::Client`. Most return a `Tacokit::Resource` object which behaves similar to an `OpenStruct`.
131
+
132
+ ### Boards
127
133
 
128
134
  ```ruby
129
- client.boards
135
+ board = client.board(board_id) # retrieve board resource by board id
136
+ # => {:id=>"54...", :name=>"Work in Progress", ... }
130
137
 
131
- client.boards("rossta")
138
+ board.name
139
+ # => "Work in Progress"
132
140
 
133
- board_id = "swezQ9XS" # short link to "Test Board" for Tacokit
141
+ client.boards # retrieve boards for client account
142
+ # => [{:id=>"54...", :name=>"Work in Progress", ... }, {...}]
134
143
 
135
- board = client.board(board_id)
144
+ client.boards("rossta") # retrieve board for user 'rossta'
145
+ # => [{:id=>"32...", :name=>"Tacokit Ideas", ... }, {...}]
136
146
 
137
- board.name = "Ice Box"
147
+ client.update_board(board, name: "TODO") # change board attributes
148
+ # => {:id=>"54...", :name=>"TODO", ... }
138
149
 
139
- client.update_board(board.id, name: "TODO")
150
+ client.add_board_member(board, 'rosskaff@gmail.com', 'Ross Kaffenberger') # add
151
+ me to your card
152
+
153
+ client.create_board("All We Need is Love") # all you need is a name
140
154
  ```
141
155
 
142
- Working with cards
156
+ ### Cards
143
157
 
144
158
  ```ruby
145
- client.cards
159
+ card = client.card(card_id) # retrieve card by card id
160
+ # => {:id=>"12...", :name=>"Call Mom", ... }
161
+
162
+ card.name
163
+ # => "Call Mom"
164
+
165
+ client.cards # retrieve cards for client account
166
+ # => [{:id=>"12...", :name=>"Call Mom", ... }, {...}]
146
167
 
147
- client.cards("rossta")
168
+ client.cards("rossta") # retrieve cards for user 'rossta'
169
+ # => [{:id=>"34...", :name=>"Buy Milk", ... }, {...}]
148
170
 
149
- client.board_cards(board_id)
171
+ client.board_cards(board) # retrieve cards for a board
172
+ # => [{:id=>"56...", :name=>"Another Card", ... }, {...}]
150
173
 
151
- card_id = "SpbauOpX" # short link to card on "Test Board"
174
+ client.update_card(card, name: "Wish List") # change card attributes
175
+ # => {:id=>"12...", :name=>"Wish List", ... }
152
176
 
153
- card.name = "Shopping List"
177
+ client.move_card(card, list_id: list_id) # move card to another list
154
178
 
155
- client.update_card(card.id, name: "Wish List")
179
+ client.card_members(card) # retrieve members assigned to card
156
180
 
157
- client.move_card(card.id, list_id: list_id)
181
+ client.attach_file(card, "https://pbs.twimg.com/media/CCKtnZmUsAEUAX2.jpg:large") # attach by url or file path
182
+
183
+ client.add_comment(card, "Nice jorb!") # troll cards
184
+
185
+ client.subscribe_to_card(card) # keep client account notified
186
+
187
+ client.archive_card(card) # send card into the abyss
188
+
189
+ client.restore_card(card) # save card back from the abyss
158
190
  ```
159
191
 
160
- Working with lists
192
+ ### Lists
161
193
 
162
194
  ```ruby
163
- client.lists(board_id)
195
+ list = client.list(list_id) # retrieve list by a list id
196
+ # => {:id=>"78...", :name=>"Ready", ... }
197
+
198
+ list.name
199
+ # => "Ready"
200
+
201
+ client.lists(board) # retrieve lists for a board
202
+ # => [{:id=>"56...", :name=>"Blocked", ... }, {...}]
164
203
 
165
- list = client.list(list_id)
204
+ client.update_list(list, name: "Done") # change list attributes
205
+ # => {:id=>"78...", :name=>"Done", ... }
166
206
 
167
- list.name = "Work in Progress"
207
+ client.create_list(board.id, "Finished") # add a new list to a board
168
208
 
169
- client.update_list(list.id, name: "Done")
209
+ client.archive_list_cards(list) # send all list cards to the abyss
170
210
  ```
171
211
 
172
212
  ## Contributing
@@ -14,7 +14,7 @@ module Tacokit
14
14
  # @option options [String] :return_url URL the token should be returned to
15
15
  # @option options [String] :scope Comma-separated list of one or more of "read", "write", "account"
16
16
  # @option options [String] :expiration "1hour", "1day", "30days", "never"
17
- # @see https://trello.com/docs/gettingstarted/authorize.html
17
+ # @see https://developers.trello.com/authorize
18
18
  def authorize(params = {})
19
19
  open_url authorize_url(params)
20
20
  end
@@ -3,70 +3,70 @@ module Tacokit
3
3
  module Actions
4
4
  # Retrieve an action
5
5
  #
6
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction
6
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction
7
7
  def action(action_id, options = nil)
8
8
  get action_path(action_id), options
9
9
  end
10
10
 
11
11
  # Retrieve an action's board
12
12
  #
13
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction-field
13
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction-field
14
14
  def action_board(action_id, fields = "all")
15
15
  action_resource action_id, "board", fields: fields
16
16
  end
17
17
 
18
18
  # Retrieve an actions" card
19
19
  #
20
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction-card
20
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction-card
21
21
  def action_card(action_id, fields = "all")
22
22
  action_resource action_id, "card", fields: fields
23
23
  end
24
24
 
25
25
  # Retrive an action's entities
26
26
  #
27
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction-entities
27
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction-entities
28
28
  def action_entities(action_id)
29
29
  action_resource action_id, "entities"
30
30
  end
31
31
 
32
32
  # Retrieve an action's list
33
33
  #
34
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction-list
34
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction-list
35
35
  def action_list(action_id, fields = "all")
36
36
  action_resource action_id, "list", fields: fields
37
37
  end
38
38
 
39
39
  # Retrieve an actions" member
40
40
  #
41
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction-member
41
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction-member
42
42
  def action_member(action_id, fields = "all")
43
43
  action_resource action_id, "member", fields: fields
44
44
  end
45
45
 
46
46
  # Retrieve an action's creator
47
47
  #
48
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction-membercreator
48
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction-membercreator
49
49
  def action_member_creator(action_id, fields = "all")
50
50
  action_resource action_id, "memberCreator", fields: fields
51
51
  end
52
52
 
53
53
  # Retrieve an action's org
54
54
  #
55
- # @see https://trello.com/docs/api/action/index.html#get-1-actions-idaction-organization
55
+ # @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction-organization
56
56
  def action_organization(action_id, fields = "all")
57
57
  action_resource action_id, "organization", fields: fields
58
58
  end
59
59
 
60
60
  # Update an action
61
61
  #
62
- # @see https://trello.com/docs/api/action/index.html#put-1-actions-idaction
62
+ # @see https://developers.trello.com/advanced-reference/action#put-1-actions-idaction
63
63
  def update_action(action_id, options = {})
64
64
  put action_path(action_id), options
65
65
  end
66
66
 
67
67
  # Set new text for an action
68
68
  #
69
- # @see https://trello.com/docs/api/action/index.html#put-1-actions-idaction-text
69
+ # @see https://developers.trello.com/advanced-reference/action#put-1-actions-idaction-text
70
70
  def update_action_text(action_id, text)
71
71
  put action_path(action_id, "text"), value: text
72
72
  end
@@ -74,7 +74,7 @@ module Tacokit
74
74
 
75
75
  # Delete an action
76
76
  #
77
- # @see https://trello.com/docs/api/action/index.html#delete-1-actions-idaction
77
+ # @see https://developers.trello.com/advanced-reference/action#delete-1-actions-idaction
78
78
  def delete_action(action_id)
79
79
  delete action_path(action_id)
80
80
  end
@@ -3,49 +3,49 @@ module Tacokit
3
3
  module Boards
4
4
  # Retrieve a board
5
5
  #
6
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id
6
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id
7
7
  def board(board_id, options = nil)
8
8
  get board_path(board_id), options
9
9
  end
10
10
 
11
11
  # Retrieve a board's actions
12
12
  #
13
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-actions
13
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-actions
14
14
  def board_actions(board_id, options = {})
15
15
  paginated_board_resource(board_id, "actions", options)
16
16
  end
17
17
 
18
18
  # Retrieve a board's stars
19
19
  #
20
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-boardstars
20
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-boardstars
21
21
  def board_stars(board_id, options = {})
22
22
  board_resource(board_id, "board_stars", options)
23
23
  end
24
24
 
25
25
  # Retrieve a board's cards
26
26
  #
27
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-cards
27
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-cards
28
28
  def board_cards(board_id, options = {})
29
29
  paginated_board_resource(board_id, "cards", options)
30
30
  end
31
31
 
32
32
  # Retrieve a board's checklists
33
33
  #
34
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-checklists
34
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-checklists
35
35
  def board_checklists(board_id, options = {})
36
36
  board_resource(board_id, "checklists", options)
37
37
  end
38
38
 
39
39
  # Retrieve a board's labels
40
40
  #
41
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-labels
41
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-labels
42
42
  def board_labels(board_id, options = {})
43
43
  board_resource(board_id, "labels", options)
44
44
  end
45
45
 
46
46
  # Retrieve a board's lists
47
47
  #
48
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-lists
48
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-lists
49
49
  def lists(board_id, options = {})
50
50
  board_resource(board_id, "lists", options)
51
51
  end
@@ -53,35 +53,35 @@ module Tacokit
53
53
 
54
54
  # Retrieve a board's members
55
55
  #
56
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-members
56
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-members
57
57
  def board_members(board_id, options = {})
58
58
  board_resource(board_id, "members", options)
59
59
  end
60
60
 
61
61
  # Retrieve your preferences for a board
62
62
  #
63
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-myprefs
63
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-myprefs
64
64
  def board_preferences(board_id, options = {})
65
65
  board_resource(board_id, "my_prefs", options)
66
66
  end
67
67
 
68
68
  # Retrieve a board's organization
69
69
  #
70
- # @see https://trello.com/docs/api/board/index.html#get-1-boards-board-id-organization
70
+ # @see https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-organization
71
71
  def board_organization(board_id, options = {})
72
72
  board_resource(board_id, "organization", options)
73
73
  end
74
74
 
75
75
  # Update board attributes
76
76
  #
77
- # @see https://trello.com/docs/api/board/index.html#put-1-boards-board-id
77
+ # @see https://developers.trello.com/advanced-reference/board#put-1-boards-board-id
78
78
  def update_board(board_id, options = {})
79
79
  put board_path(board_id), options
80
80
  end
81
81
 
82
82
  # Add a member to a board
83
83
  #
84
- # @see https://trello.com/docs/api/board/index.html#put-1-boards-board-id-members-idmember
84
+ # @see https://developers.trello.com/advanced-reference/board#put-1-boards-board-id-members-idmember
85
85
  def add_board_member(board_id, email, full_name, options = {})
86
86
  options.update \
87
87
  email: email,
@@ -91,7 +91,7 @@ module Tacokit
91
91
 
92
92
  # Update a board member's type
93
93
  #
94
- # @see https://trello.com/docs/api/board/index.html#put-1-boards-board-id-members-idmember
94
+ # @see https://developers.trello.com/advanced-reference/board#put-1-boards-board-id-members-idmember
95
95
  def update_board_member(board_id, member_id, type)
96
96
  update_board_resource(board_id, "members", member_id, type: type)
97
97
  end