tacokit 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +4 -0
  4. data/.travis.yml +3 -0
  5. data/Gemfile +2 -1
  6. data/README.md +140 -47
  7. data/Rakefile +13 -0
  8. data/bin/_guard-core +16 -0
  9. data/bin/console +14 -0
  10. data/bin/guard +16 -0
  11. data/bin/rake +16 -0
  12. data/bin/rspec +16 -0
  13. data/bin/rubocop +16 -0
  14. data/bin/setup +7 -0
  15. data/lib/tacokit/authorization.rb +8 -9
  16. data/lib/tacokit/client.rb +14 -20
  17. data/lib/tacokit/client/actions.rb +30 -14
  18. data/lib/tacokit/client/boards.rb +112 -16
  19. data/lib/tacokit/client/cards.rb +251 -72
  20. data/lib/tacokit/client/checklists.rb +25 -14
  21. data/lib/tacokit/client/labels.rb +11 -4
  22. data/lib/tacokit/client/lists.rb +66 -13
  23. data/lib/tacokit/client/members.rb +118 -42
  24. data/lib/tacokit/client/notifications.rb +29 -2
  25. data/lib/tacokit/client/organizations.rb +13 -5
  26. data/lib/tacokit/client/searches.rb +17 -2
  27. data/lib/tacokit/client/tokens.rb +8 -2
  28. data/lib/tacokit/client/types.rb +4 -2
  29. data/lib/tacokit/client/webhooks.rb +17 -4
  30. data/lib/tacokit/collection.rb +6 -5
  31. data/lib/tacokit/configuration.rb +10 -2
  32. data/lib/tacokit/middleware.rb +16 -0
  33. data/lib/tacokit/resource.rb +7 -6
  34. data/lib/tacokit/transform.rb +2 -4
  35. data/lib/tacokit/utils.rb +7 -4
  36. data/lib/tacokit/version.rb +2 -1
  37. data/tacokit.gemspec +4 -4
  38. metadata +17 -273
  39. data/spec/cassettes/Tacokit_Client/_connection/authorized_GET_request_with_app_key_and_token_params.json +0 -1
  40. data/spec/cassettes/Tacokit_Client_Actions/_action/returns_a_token_authorized_action.json +0 -1
  41. data/spec/cassettes/Tacokit_Client_Actions/_action/returns_oauth_authorized_board.json +0 -1
  42. data/spec/cassettes/Tacokit_Client_Actions/_action_board/returns_action_board.json +0 -1
  43. data/spec/cassettes/Tacokit_Client_Actions/_action_card/returns_action_card.json +0 -1
  44. data/spec/cassettes/Tacokit_Client_Actions/_action_entities/returns_action_entities.json +0 -1
  45. data/spec/cassettes/Tacokit_Client_Actions/_action_list/returns_action_list.json +0 -1
  46. data/spec/cassettes/Tacokit_Client_Actions/_delete_action/deletes_an_action.json +0 -1
  47. data/spec/cassettes/Tacokit_Client_Actions/_update_action/updates_an_action.json +0 -1
  48. data/spec/cassettes/Tacokit_Client_Actions/_update_action_text/updates_an_action.json +0 -1
  49. data/spec/cassettes/Tacokit_Client_Boards/_add_board_member/adds_invites_member_to_board.json +0 -1
  50. data/spec/cassettes/Tacokit_Client_Boards/_board/returns_a_token_authorized_board.json +0 -1
  51. data/spec/cassettes/Tacokit_Client_Boards/_board/returns_oauth_authorized_board.json +0 -1
  52. data/spec/cassettes/Tacokit_Client_Boards/_board_actions/returns_board_actions.json +0 -1
  53. data/spec/cassettes/Tacokit_Client_Boards/_board_cards/returns_board_cards.json +0 -1
  54. data/spec/cassettes/Tacokit_Client_Boards/_board_checklists/returns_board_checklists.json +0 -1
  55. data/spec/cassettes/Tacokit_Client_Boards/_board_labels/returns_board_labels.json +0 -1
  56. data/spec/cassettes/Tacokit_Client_Boards/_board_lists/returns_board_lists.json +0 -1
  57. data/spec/cassettes/Tacokit_Client_Boards/_board_members/returns_board_members.json +0 -1
  58. data/spec/cassettes/Tacokit_Client_Boards/_board_organization/returns_board_organization.json +0 -1
  59. data/spec/cassettes/Tacokit_Client_Boards/_board_preferences/returns_preferences_for_a_board.json +0 -1
  60. data/spec/cassettes/Tacokit_Client_Boards/_board_stars/returns_board_stars.json +0 -1
  61. data/spec/cassettes/Tacokit_Client_Boards/_update_board/updates_a_board.json +0 -1
  62. data/spec/cassettes/Tacokit_Client_Boards/_update_board/updates_nested_resource.json +0 -1
  63. data/spec/cassettes/Tacokit_Client_Boards/_update_board_member/updates_member.json +0 -1
  64. data/spec/cassettes/Tacokit_Client_Cards/_add_comment/creates_a_comment.json +0 -1
  65. data/spec/cassettes/Tacokit_Client_Cards/_add_label/adds_label_to_card.json +0 -1
  66. data/spec/cassettes/Tacokit_Client_Cards/_add_member_to_card/adds_member_to_card.json +0 -1
  67. data/spec/cassettes/Tacokit_Client_Cards/_archive_card/archives_card.json +0 -1
  68. data/spec/cassettes/Tacokit_Client_Cards/_archive_card/restore_card.json +0 -1
  69. data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_an_attachment.json +0 -1
  70. data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachments.json +0 -1
  71. data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_card_resource.json +0 -1
  72. data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_id.json +0 -1
  73. data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_short_link.json +0 -1
  74. data/spec/cassettes/Tacokit_Client_Cards/_card_actions/returns_card_actions.json +0 -1
  75. data/spec/cassettes/Tacokit_Client_Cards/_card_board/returns_card_board.json +0 -1
  76. data/spec/cassettes/Tacokit_Client_Cards/_card_list/returns_a_list.json +0 -1
  77. data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members.json +0 -1
  78. data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members_voted.json +0 -1
  79. data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_check_item_states.json +0 -1
  80. data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_checklists.json +0 -1
  81. data/spec/cassettes/Tacokit_Client_Cards/_create_card/creates_a_card.json +0 -1
  82. data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/attaches_external_url.json +0 -1
  83. data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/uploads_local_file.json +0 -1
  84. data/spec/cassettes/Tacokit_Client_Cards/_delete_card/deletes_a_card.json +0 -1
  85. data/spec/cassettes/Tacokit_Client_Cards/_delete_comment/deletes_comment.json +0 -1
  86. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_a_new_position.json +0 -1
  87. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_another_board_list.json +0 -1
  88. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_board.json +0 -1
  89. data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_list.json +0 -1
  90. data/spec/cassettes/Tacokit_Client_Cards/_move_card/raises_error_if_missing_options.json +0 -1
  91. data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_new_checklist_by_name.json +0 -1
  92. data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/copies_a_checklist_by_id.json +0 -1
  93. data/spec/cassettes/Tacokit_Client_Cards/_stickers/returns_stickers.json +0 -1
  94. data/spec/cassettes/Tacokit_Client_Cards/_update_card/updates_a_card.json +0 -1
  95. data/spec/cassettes/Tacokit_Client_Cards/_update_checklist_item/updates_checklist_item.json +0 -1
  96. data/spec/cassettes/Tacokit_Client_Cards/_update_comment/updates_a_comment.json +0 -1
  97. data/spec/cassettes/Tacokit_Client_Cards/_vote/adds_a_member_s_vote_to_card.json +0 -1
  98. data/spec/cassettes/Tacokit_Client_Checklists/_check_items/adds_a_checklist_check_item.json +0 -1
  99. data/spec/cassettes/Tacokit_Client_Checklists/_check_items/retrieves_checklist_check_items.json +0 -1
  100. data/spec/cassettes/Tacokit_Client_Checklists/_checklist/returns_a_checklist_by_id.json +0 -1
  101. data/spec/cassettes/Tacokit_Client_Checklists/_create_checklist/creates_a_checklist.json +0 -1
  102. data/spec/cassettes/Tacokit_Client_Checklists/_delete_checklist/deletes_a_checklist.json +0 -1
  103. data/spec/cassettes/Tacokit_Client_Checklists/_update_checklist/updates_a_checklist.json +0 -1
  104. data/spec/cassettes/Tacokit_Client_Labels/_create_label/creates_a_label.json +0 -1
  105. data/spec/cassettes/Tacokit_Client_Labels/_delete_label/deletes_a_label.json +0 -1
  106. data/spec/cassettes/Tacokit_Client_Labels/_label/returns_a_label_by_id.json +0 -1
  107. data/spec/cassettes/Tacokit_Client_Labels/_update_label/updates_a_label.json +0 -1
  108. data/spec/cassettes/Tacokit_Client_Lists/_archive_list_cards/should_archive_cards_in_list.json +0 -1
  109. data/spec/cassettes/Tacokit_Client_Lists/_create_list/creates_a_list.json +0 -1
  110. data/spec/cassettes/Tacokit_Client_Lists/_list/returns_a_list_by_id.json +0 -1
  111. data/spec/cassettes/Tacokit_Client_Lists/_list_actions/returns_list_actions.json +0 -1
  112. data/spec/cassettes/Tacokit_Client_Lists/_list_board/returns_list_board.json +0 -1
  113. data/spec/cassettes/Tacokit_Client_Lists/_list_cards/returns_list_cards.json +0 -1
  114. data/spec/cassettes/Tacokit_Client_Lists/_move_list_cards/should_move_cards_in_list.json +0 -1
  115. data/spec/cassettes/Tacokit_Client_Lists/_update_list/updates_a_list.json +0 -1
  116. data/spec/cassettes/Tacokit_Client_Members/_actions/returns_member_actions.json +0 -1
  117. data/spec/cassettes/Tacokit_Client_Members/_boards/returns_for_me_with_options_as_first_arg.json +0 -1
  118. data/spec/cassettes/Tacokit_Client_Members/_boards/returns_member_boards.json +0 -1
  119. data/spec/cassettes/Tacokit_Client_Members/_cards/returns_member_cards.json +0 -1
  120. data/spec/cassettes/Tacokit_Client_Members/_member/accepts_a_resource.json +0 -1
  121. data/spec/cassettes/Tacokit_Client_Members/_member/authenticated/returns_self.json +0 -1
  122. data/spec/cassettes/Tacokit_Client_Members/_member/returns_a_member.json +0 -1
  123. data/spec/cassettes/Tacokit_Client_Members/_member/returns_self.json +0 -1
  124. data/spec/cassettes/Tacokit_Client_Members/_member/supports_query_fields_as_string_or_array.json +0 -1
  125. data/spec/cassettes/Tacokit_Client_Members/_notifications/returns_member_notifications.json +0 -1
  126. data/spec/cassettes/Tacokit_Client_Members/_organizations/returns_member_organizations.json +0 -1
  127. data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_tokens.json +0 -1
  128. data/spec/cassettes/Tacokit_Client_Members/_update_member/updates_a_member.json +0 -1
  129. data/spec/cassettes/Tacokit_Client_Members/_update_member/updates_nested_resource.json +0 -1
  130. data/spec/cassettes/Tacokit_Client_Notifications/_notification/returns_a_notification_by_id.json +0 -1
  131. data/spec/cassettes/Tacokit_Client_Notifications/_update_notification/updates_a_notification.json +0 -1
  132. data/spec/cassettes/Tacokit_Client_Organizations/_create_organization/creates_a_organization.json +0 -1
  133. data/spec/cassettes/Tacokit_Client_Organizations/_delete_organization/deletes_a_organization.json +0 -1
  134. data/spec/cassettes/Tacokit_Client_Organizations/_organization/returns_an_organization_by_id.json +0 -1
  135. data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_actions.json +0 -1
  136. data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_boards.json +0 -1
  137. data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_members.json +0 -1
  138. data/spec/cassettes/Tacokit_Client_Organizations/_update_organization/updates_a_organization.json +0 -1
  139. data/spec/cassettes/Tacokit_Client_Searches/_search/returns_search_result.json +0 -1
  140. data/spec/cassettes/Tacokit_Client_Tokens/_delete_token/deletes_a_token.json +0 -1
  141. data/spec/cassettes/Tacokit_Client_Tokens/_token/returns_a_token_for_token_string.json +0 -1
  142. data/spec/cassettes/Tacokit_Client_Tokens/_token_resource/returns_token_member.json +0 -1
  143. data/spec/cassettes/Tacokit_Client_Tokens/_token_resource/returns_token_webhooks.json +0 -1
  144. data/spec/cassettes/Tacokit_Client_Types/_type/returns_a_type_by_id.json +0 -1
  145. data/spec/cassettes/Tacokit_Client_Webhooks/_create_webhook/creates_a_webhook.json +0 -1
  146. data/spec/cassettes/Tacokit_Client_Webhooks/_delete_webhook/deletes_a_webhook.json +0 -1
  147. data/spec/cassettes/Tacokit_Client_Webhooks/_update_webhook/updates_a_webhook.json +0 -1
  148. data/spec/cassettes/Tacokit_Client_Webhooks/_webhook/returns_a_webhook_by_short_link.json +0 -1
  149. data/spec/fixtures/taco.png +0 -0
  150. data/spec/spec_helper.rb +0 -171
  151. data/spec/tacokit/authorization_spec.rb +0 -47
  152. data/spec/tacokit/client/actions_spec.rb +0 -137
  153. data/spec/tacokit/client/boards_spec.rb +0 -171
  154. data/spec/tacokit/client/cards_spec.rb +0 -446
  155. data/spec/tacokit/client/checklists_spec.rb +0 -89
  156. data/spec/tacokit/client/labels_spec.rb +0 -62
  157. data/spec/tacokit/client/lists_spec.rb +0 -131
  158. data/spec/tacokit/client/members_spec.rb +0 -145
  159. data/spec/tacokit/client/notifications_spec.rb +0 -25
  160. data/spec/tacokit/client/organizations_spec.rb +0 -79
  161. data/spec/tacokit/client/searches_spec.rb +0 -11
  162. data/spec/tacokit/client/tokens_spec.rb +0 -33
  163. data/spec/tacokit/client/types_spec.rb +0 -11
  164. data/spec/tacokit/client/webhooks_spec.rb +0 -61
  165. data/spec/tacokit/client_spec.rb +0 -28
  166. data/spec/tacokit/configuration_spec.rb +0 -50
  167. data/spec/tacokit/middleware/raise_error_spec.rb +0 -34
  168. data/spec/tacokit/resource_spec.rb +0 -151
  169. data/spec/tacokit/transform_spec.rb +0 -133
  170. data/spec/tacokit_spec.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 893e6fcc338a5577d85ae6aeab7d2abd37aba994
4
- data.tar.gz: 31289e149b682205ca77126dd117ba03ec0fcc52
3
+ metadata.gz: f04b3d5706a939e80215228ad9189924458855ad
4
+ data.tar.gz: bbb0d40148e65c9b4a3b08d758088dc3c54448ff
5
5
  SHA512:
6
- metadata.gz: 7daa990bf2a35abd1f69d58be4250023c1ed4b4f042ce6b23e4d162faa7e51f7e4f09c51adde90cd0de9ee60e79802d0c596b1a3656616ce7f23a858631a4bfa
7
- data.tar.gz: 5d52cafaf8d20fd5602fe41015c75112776c98322a7bec1380389bad48c39368b03d5b5dc64812b69b734a8aeca9948431ab005d344ed124d031fab97867a23b
6
+ metadata.gz: d02daaf1940fd81848461fc0b549f11c485365111a1c79cd390e522028572551cc422bc08fda9491cd53fb87e07eb32629a09310a897fe553c511e7204ad5b32
7
+ data.tar.gz: 035b1be4fd4623497df3c3f55ba4cff1636fa0eec5a0be68648945d245e505b76e0df19cc33d080508e4cea77d25e22bd85c45e807350ba8eb549382d218fae5
data/.gitignore CHANGED
@@ -14,4 +14,5 @@
14
14
  mkmf.log
15
15
  .env
16
16
  .env.development
17
+ .env.test
17
18
  .ruby-version
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
2
  Exclude:
3
+ - "bin/**"
3
4
  - "Guardfile"
4
5
  - "spec/cassettes/**/*"
5
6
  - "vendor/**/*"
@@ -52,6 +53,9 @@ Style/Not:
52
53
  Style/DoubleNegation:
53
54
  Enabled: false
54
55
 
56
+ Style/ParallelAssignment:
57
+ Enabled: false
58
+
55
59
  Documentation:
56
60
  Enabled: false # TODO: Enable again once we have more docs
57
61
 
@@ -4,11 +4,14 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1
7
+ - 2.2
8
+ - 2.3.0
7
9
  - ruby-head
8
10
 
9
11
  sudo: false
10
12
  cache: bundler
11
13
 
14
+ before_install: gem install bundler -v 1.11.2
12
15
  bundler_args: --without development --retry=3 --jobs=3
13
16
 
14
17
  script:
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem "guard-rspec"
9
9
  gem "launchy"
10
10
  gem "oauth"
11
11
  gem "pry"
12
- gem "pry-byebug", platforms: :ruby_21
12
+ gem "pry-byebug", platforms: [:ruby_21, :ruby_22]
13
13
  gem "rake"
14
14
  gem "rb-fsevent"
15
15
  gem "rspec", "~> 3.3"
@@ -18,3 +18,4 @@ gem "sinatra"
18
18
  gem "vcr"
19
19
  gem "webmock"
20
20
  gem "multi_json"
21
+ gem "yard"
data/README.md CHANGED
@@ -7,12 +7,11 @@ inspired by [ocktokit.rb](https://github.com/ocktokit/ocktokit.rb)
7
7
 
8
8
  This is Taco.
9
9
 
10
- ![Taco][taco]
11
- [taco]: http://cl.ly/image/2p1x3K1X160b/taco.png
10
+ ![Taco](http://cl.ly/image/2p1x3K1X160b/taco.png)
12
11
 
13
12
  ## Quick Start
14
13
 
15
- Add this line to your application"s Gemfile:
14
+ Add this line to your application's Gemfile:
16
15
 
17
16
  ```ruby
18
17
  gem "tacokit"
@@ -20,7 +19,9 @@ gem "tacokit"
20
19
 
21
20
  ... or install it yourself as:
22
21
 
23
- $ gem install tacokit
22
+ ```
23
+ $ gem install tacokit
24
+ ```
24
25
 
25
26
  Configure the client with public-read application credentials:
26
27
 
@@ -34,8 +35,8 @@ Tacokit.configure do |c|
34
35
  end
35
36
  ```
36
37
 
37
- Make requests to Trello API methods using module-level configuration or as
38
- client instance methods.
38
+ Make requests to Trello API methods using module-level configuration or as client instance methods.
39
+
39
40
  ```ruby
40
41
  # Fetch the current member
41
42
  Tacokit.member
@@ -49,6 +50,7 @@ client = Tacokit::Client.new app_key: "4ppk3y"
49
50
  # Fetch a member
50
51
  client.member "tacokit"
51
52
  ```
53
+
52
54
  ## Authentication
53
55
 
54
56
  ### Application Authorization
@@ -103,9 +105,9 @@ client = Tacokit::Client.new app_key: "4ppk3y", oauth_token: "04utht0k3n"
103
105
  #### OAuth Tacokit Sandbox
104
106
 
105
107
  To experiment with OAuth tokens for development, visit the [Tacokit
106
- Sandbox](https://tacokit.herokuapp.com) and enter your Trello app key and app secret.
108
+ Sandbox](https://tacokit.herokuapp.com) and enter your Trello app key and app secret.
107
109
 
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).
110
+ 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).
109
111
 
110
112
  #### Resources
111
113
 
@@ -119,10 +121,10 @@ For more information on setting up Trello OAuth for your web application
119
121
 
120
122
  Default Tacokit client values can be set by values in ENV:
121
123
 
122
- ```shell
123
- TRELLO_APP_KEY=4ppk3y
124
- TRELLO_APP_SECRET=4pps3cr3t
125
- TRELLO_APP_TOKEN=4ppt0k3n
124
+ ```ruby
125
+ export TRELLO_APP_KEY=4ppk3y
126
+ export TRELLO_APP_SECRET=4pps3cr3t
127
+ export TRELLO_APP_TOKEN=4ppt0k3n
126
128
  ```
127
129
 
128
130
  ## Usage
@@ -131,82 +133,173 @@ All requests are called on instances of a `Tacokit::Client`. Most return a `Taco
131
133
 
132
134
  ### Boards
133
135
 
136
+ Board endpoints typically take a board id, short url, or board resource as the first argument.
137
+
138
+ See the client [Board docs](https://rossta.net/tacokit.rb/Tacokit/Client/Boards.html) for more details.
139
+
134
140
  ```ruby
135
- board = client.board(board_id) # retrieve board resource by board id
141
+ # retrieve board resource by board id
142
+ board = client.board(board_id)
136
143
  # => {:id=>"54...", :name=>"Work in Progress", ... }
137
144
 
145
+ # access card attributes by message sending
138
146
  board.name
139
147
  # => "Work in Progress"
140
148
 
141
- client.boards # retrieve boards for client account
149
+ # retrieve boards for client account
150
+ boards = client.boards
142
151
  # => [{:id=>"54...", :name=>"Work in Progress", ... }, {...}]
143
152
 
144
- client.boards("rossta") # retrieve board for user 'rossta'
153
+ # retrieve board for user 'rossta'
154
+ boards = client.boards("rossta")
145
155
  # => [{:id=>"32...", :name=>"Tacokit Ideas", ... }, {...}]
146
156
 
147
- client.update_board(board, name: "TODO") # change board attributes
157
+ # change board attributes
158
+ board = client.update_board(board, name: "TODO")
148
159
  # => {:id=>"54...", :name=>"TODO", ... }
149
160
 
150
- client.add_board_member(board, 'rosskaff@gmail.com', 'Ross Kaffenberger') # add
151
- me to your card
161
+ # retrieve lists for a board
162
+ client.lists(board)
163
+ # => [{:id=>"56...", :name=>"Blocked", ... }, {...}]
164
+
165
+ # retrieve cards for a board
166
+ client.board_cards(board)
167
+ # => [{:id# =>"56...", :name# =>"Another Card", ... }, {...}]
152
168
 
153
- client.create_board("All We Need is Love") # all you need is a name
169
+ # add me to your card
170
+ client.add_board_member(board, 'rosskaff@gmail.com', 'Ross Kaffenberger')
171
+
172
+ # all you need is a name
173
+ client.create_board("All We Need is Love")
154
174
  ```
155
175
 
156
176
  ### Cards
157
177
 
158
- ```ruby
159
- card = client.card(card_id) # retrieve card by card id
160
- # => {:id=>"12...", :name=>"Call Mom", ... }
178
+ Card endpoints typically take a card id, short url, or card resource as the first argument.
161
179
 
162
- card.name
163
- # => "Call Mom"
164
-
165
- client.cards # retrieve cards for client account
166
- # => [{:id=>"12...", :name=>"Call Mom", ... }, {...}]
180
+ See the client [Card docs](https://rossta.net/tacokit.rb/Tacokit/Client/Cards.html) for more details.
167
181
 
168
- client.cards("rossta") # retrieve cards for user 'rossta'
169
- # => [{:id=>"34...", :name=>"Buy Milk", ... }, {...}]
182
+ ```ruby
183
+ # retrieve card by card id
184
+ card = client.card(card_id)
185
+ # => {:id# =>"12...", :name# =>"Call Mom", ... }
170
186
 
171
- client.board_cards(board) # retrieve cards for a board
172
- # => [{:id=>"56...", :name=>"Another Card", ... }, {...}]
187
+ # access card attributes by message sending
188
+ card.name
189
+ # => "Call wife"
173
190
 
174
- client.update_card(card, name: "Wish List") # change card attributes
175
- # => {:id=>"12...", :name=>"Wish List", ... }
191
+ # change card attributes
192
+ card = client.update_card(card, name: "Wish List")
193
+ # => {:id# =>"12...", :name# =>"Wish List", ... }
176
194
 
177
- client.move_card(card, list_id: list_id) # move card to another list
195
+ # move card to another list
196
+ client.move_card(card, list_id: list_id)
178
197
 
179
- client.card_members(card) # retrieve members assigned to card
198
+ # retrieve members assigned to card
199
+ client.card_members(card)
180
200
 
181
- client.attach_file(card, "https://pbs.twimg.com/media/CCKtnZmUsAEUAX2.jpg:large") # attach by url or file path
201
+ # attach by url or file path
202
+ client.attach_file(card, "https://pbs.twimg.com/media/CCKtnZmUsAEUAX2.jpg:large")
182
203
 
183
- client.add_comment(card, "Nice jorb!") # troll cards
204
+ # add comment to a card
205
+ client.add_comment(card, "Nice jorb!")
184
206
 
185
- client.subscribe_to_card(card) # keep client account notified
207
+ # receive notifications for card updates
208
+ client.subscribe_to_card(card)
186
209
 
187
- client.archive_card(card) # send card into the abyss
210
+ # send card into the abyss
211
+ client.archive_card(card)
188
212
 
189
- client.restore_card(card) # save card back from the abyss
213
+ # bring card back from the abyss
214
+ client.restore_card(card)
190
215
  ```
191
216
 
192
217
  ### Lists
193
218
 
219
+ List endpoints typically take a list id or list resource as the first argument.
220
+
221
+ See the client [List docs](https://rossta.net/tacokit.rb/Tacokit/Client/Lists.html) for more details.
222
+
194
223
  ```ruby
195
- list = client.list(list_id) # retrieve list by a list id
224
+ # retrieve list by a list id
225
+ list = client.list(list_id)
196
226
  # => {:id=>"78...", :name=>"Ready", ... }
197
227
 
228
+ # access card attributes by message sending
198
229
  list.name
199
230
  # => "Ready"
200
231
 
201
- client.lists(board) # retrieve lists for a board
202
- # => [{:id=>"56...", :name=>"Blocked", ... }, {...}]
203
-
204
- client.update_list(list, name: "Done") # change list attributes
232
+ # change list attributes
233
+ client.update_list(list, name: "Done")
205
234
  # => {:id=>"78...", :name=>"Done", ... }
206
235
 
207
- client.create_list(board.id, "Finished") # add a new list to a board
236
+ # add a new list to a board
237
+ client.create_list(board.id, "Finished")
238
+ # => {:id => "89...", :name=>"Finished", ... }
239
+
240
+ # send all list cards to the abyss
241
+ client.archive_list_cards(list)
242
+ ```
208
243
 
209
- client.archive_list_cards(list) # send all list cards to the abyss
244
+ ### Members
245
+
246
+ Most of the client member endpoints take an optional member name as the first argument. In many cases, the name can be omitted where it is assumed to be the current member (also given as "me").
247
+
248
+ See the client [Member docs](https://rossta.net/tacokit.rb/Tacokit/Client/Members.html) for more details.
249
+
250
+ ```ruby
251
+ # Retrieve current member
252
+ me = client.member
253
+ # => {:id=>"548a6696b3b9918beb144b07",
254
+ # :avatar_hash=>"cb0df45055bac84e7c5fb728e00e2015",
255
+ # :bio=>"Tacokit puts the Trello API on Ruby",
256
+ # ... }
257
+
258
+ # Also
259
+ me = client.member("me")
260
+ # => {:id=>"548a6696b3b9918beb144b07",
261
+ # :avatar_hash=>"cb0df45055bac84e7c5fb728e00e2015",
262
+ # :bio=>"Tacokit puts the Trello API on Ruby",
263
+ # ... }
264
+
265
+ # Another member
266
+ rossta = client.member("rossta")
267
+ # => {:id=>"4f079adc73668b244b1c099a",
268
+ # :avatar_hash=>"706e95e427f91670bf21eee6afccee90",
269
+ # :bio=>"I write about all things web on rossta.net",
270
+ # ... }
271
+
272
+ # Retrieve my open boards, just the short links and names,
273
+ boards = client.boards(filter: "open", fields: %w[name short_url])
274
+
275
+ # Retrieve rossta's public boards with the organization embedded
276
+ boards = client.boards("rossta", filter: "public", organization: true)
277
+
278
+ # retrieve cards for client account
279
+ cards = client.cards
280
+ # => [{:id=>"12...", :name=>"Call Mom", ... }, {...}]
281
+
282
+ # retrieve cards for user 'rossta'
283
+ cards = client.cards("rossta")
284
+ # => [{:id=>"34...", :name=>"Buy Milk", ... }, {...}]
285
+ ```
286
+
287
+ ### Search
288
+
289
+ See the client [Search docs](https://rossta.net/tacokit.rb/Tacokit/Client/Searches.html) for more details.
290
+
291
+ ```ruby
292
+ Tacokit.search("rossta")
293
+ # => {:options=>
294
+ # {:terms=>[{:text=>"rossta"}],
295
+ # :modifiers=>[],
296
+ # :model_types=>["actions", "cards", "boards", "organizations", "members"],
297
+ # :partial=>false},
298
+ # :members=>
299
+ # [{:id=>"4f079adc73668b244b1c099a",
300
+ # :avatar_hash=>"706e95e427f91670bf21eee6afccee90",
301
+ # ...}]
302
+ # ...}
210
303
  ```
211
304
 
212
305
  ## Contributing
data/Rakefile CHANGED
@@ -11,3 +11,16 @@ RuboCop::RakeTask.new
11
11
 
12
12
  task test: [:spec, :rubocop]
13
13
  task default: [:spec, :rubocop]
14
+
15
+ namespace :doc do
16
+ desc "Generate docs and publish to gh-pages"
17
+ task :publish do
18
+ require "fileutils"
19
+ sh "yard doc"
20
+ sh "git checkout gh-pages"
21
+ sh "cp -R doc/* ."
22
+ sh "git commit -vam 'Update documentation'"
23
+ sh "git push origin gh-pages"
24
+ sh "git checkout -"
25
+ end
26
+ end
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application '_guard-core' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require "rubygems"
14
+ require "bundler/setup"
15
+
16
+ load Gem.bin_path("guard", "_guard-core")
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "tacokit"
5
+
6
+ require "dotenv"
7
+ Dotenv.load(
8
+ File.expand_path("../.env", __FILE__),
9
+ File.expand_path("../.env.development", __FILE__)
10
+ )
11
+
12
+ require "pry"
13
+
14
+ Pry.start
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'guard' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require "rubygems"
14
+ require "bundler/setup"
15
+
16
+ load Gem.bin_path("guard", "guard")
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require "rubygems"
14
+ require "bundler/setup"
15
+
16
+ load Gem.bin_path("rake", "rake")
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require "rubygems"
14
+ require "bundler/setup"
15
+
16
+ load Gem.bin_path("rspec-core", "rspec")
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rubocop' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require "rubygems"
14
+ require "bundler/setup"
15
+
16
+ load Gem.bin_path("rubocop", "rubocop")