tacokit 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +4 -0
- data/.travis.yml +3 -0
- data/Gemfile +2 -1
- data/README.md +140 -47
- data/Rakefile +13 -0
- data/bin/_guard-core +16 -0
- data/bin/console +14 -0
- data/bin/guard +16 -0
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/rubocop +16 -0
- data/bin/setup +7 -0
- data/lib/tacokit/authorization.rb +8 -9
- data/lib/tacokit/client.rb +14 -20
- data/lib/tacokit/client/actions.rb +30 -14
- data/lib/tacokit/client/boards.rb +112 -16
- data/lib/tacokit/client/cards.rb +251 -72
- data/lib/tacokit/client/checklists.rb +25 -14
- data/lib/tacokit/client/labels.rb +11 -4
- data/lib/tacokit/client/lists.rb +66 -13
- data/lib/tacokit/client/members.rb +118 -42
- data/lib/tacokit/client/notifications.rb +29 -2
- data/lib/tacokit/client/organizations.rb +13 -5
- data/lib/tacokit/client/searches.rb +17 -2
- data/lib/tacokit/client/tokens.rb +8 -2
- data/lib/tacokit/client/types.rb +4 -2
- data/lib/tacokit/client/webhooks.rb +17 -4
- data/lib/tacokit/collection.rb +6 -5
- data/lib/tacokit/configuration.rb +10 -2
- data/lib/tacokit/middleware.rb +16 -0
- data/lib/tacokit/resource.rb +7 -6
- data/lib/tacokit/transform.rb +2 -4
- data/lib/tacokit/utils.rb +7 -4
- data/lib/tacokit/version.rb +2 -1
- data/tacokit.gemspec +4 -4
- metadata +17 -273
- data/spec/cassettes/Tacokit_Client/_connection/authorized_GET_request_with_app_key_and_token_params.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_action/returns_a_token_authorized_action.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_action/returns_oauth_authorized_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_action_board/returns_action_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_action_card/returns_action_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_action_entities/returns_action_entities.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_action_list/returns_action_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_delete_action/deletes_an_action.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_update_action/updates_an_action.json +0 -1
- data/spec/cassettes/Tacokit_Client_Actions/_update_action_text/updates_an_action.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_add_board_member/adds_invites_member_to_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board/returns_a_token_authorized_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board/returns_oauth_authorized_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_actions/returns_board_actions.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_cards/returns_board_cards.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_checklists/returns_board_checklists.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_labels/returns_board_labels.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_lists/returns_board_lists.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_members/returns_board_members.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_organization/returns_board_organization.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_preferences/returns_preferences_for_a_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_stars/returns_board_stars.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_update_board/updates_a_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_update_board/updates_nested_resource.json +0 -1
- data/spec/cassettes/Tacokit_Client_Boards/_update_board_member/updates_member.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_add_comment/creates_a_comment.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_add_label/adds_label_to_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_add_member_to_card/adds_member_to_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_archive_card/archives_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_archive_card/restore_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_an_attachment.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachments.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_card_resource.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_short_link.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_actions/returns_card_actions.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_board/returns_card_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_list/returns_a_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members_voted.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_check_item_states.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_checklists.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_create_card/creates_a_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/attaches_external_url.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/uploads_local_file.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_card/deletes_a_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_comment/deletes_comment.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_a_new_position.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_another_board_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/raises_error_if_missing_options.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_new_checklist_by_name.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/copies_a_checklist_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_stickers/returns_stickers.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_update_card/updates_a_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_update_checklist_item/updates_checklist_item.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_update_comment/updates_a_comment.json +0 -1
- data/spec/cassettes/Tacokit_Client_Cards/_vote/adds_a_member_s_vote_to_card.json +0 -1
- data/spec/cassettes/Tacokit_Client_Checklists/_check_items/adds_a_checklist_check_item.json +0 -1
- data/spec/cassettes/Tacokit_Client_Checklists/_check_items/retrieves_checklist_check_items.json +0 -1
- data/spec/cassettes/Tacokit_Client_Checklists/_checklist/returns_a_checklist_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Checklists/_create_checklist/creates_a_checklist.json +0 -1
- data/spec/cassettes/Tacokit_Client_Checklists/_delete_checklist/deletes_a_checklist.json +0 -1
- data/spec/cassettes/Tacokit_Client_Checklists/_update_checklist/updates_a_checklist.json +0 -1
- data/spec/cassettes/Tacokit_Client_Labels/_create_label/creates_a_label.json +0 -1
- data/spec/cassettes/Tacokit_Client_Labels/_delete_label/deletes_a_label.json +0 -1
- data/spec/cassettes/Tacokit_Client_Labels/_label/returns_a_label_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Labels/_update_label/updates_a_label.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_archive_list_cards/should_archive_cards_in_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_create_list/creates_a_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_list/returns_a_list_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_list_actions/returns_list_actions.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_list_board/returns_list_board.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_list_cards/returns_list_cards.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_move_list_cards/should_move_cards_in_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Lists/_update_list/updates_a_list.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_actions/returns_member_actions.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_boards/returns_for_me_with_options_as_first_arg.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_boards/returns_member_boards.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_cards/returns_member_cards.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_member/accepts_a_resource.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_member/authenticated/returns_self.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_member/returns_a_member.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_member/returns_self.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_member/supports_query_fields_as_string_or_array.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_notifications/returns_member_notifications.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_organizations/returns_member_organizations.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_tokens.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_update_member/updates_a_member.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_update_member/updates_nested_resource.json +0 -1
- data/spec/cassettes/Tacokit_Client_Notifications/_notification/returns_a_notification_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Notifications/_update_notification/updates_a_notification.json +0 -1
- data/spec/cassettes/Tacokit_Client_Organizations/_create_organization/creates_a_organization.json +0 -1
- data/spec/cassettes/Tacokit_Client_Organizations/_delete_organization/deletes_a_organization.json +0 -1
- data/spec/cassettes/Tacokit_Client_Organizations/_organization/returns_an_organization_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_actions.json +0 -1
- data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_boards.json +0 -1
- data/spec/cassettes/Tacokit_Client_Organizations/_organization_resource/returns_organization_members.json +0 -1
- data/spec/cassettes/Tacokit_Client_Organizations/_update_organization/updates_a_organization.json +0 -1
- data/spec/cassettes/Tacokit_Client_Searches/_search/returns_search_result.json +0 -1
- data/spec/cassettes/Tacokit_Client_Tokens/_delete_token/deletes_a_token.json +0 -1
- data/spec/cassettes/Tacokit_Client_Tokens/_token/returns_a_token_for_token_string.json +0 -1
- data/spec/cassettes/Tacokit_Client_Tokens/_token_resource/returns_token_member.json +0 -1
- data/spec/cassettes/Tacokit_Client_Tokens/_token_resource/returns_token_webhooks.json +0 -1
- data/spec/cassettes/Tacokit_Client_Types/_type/returns_a_type_by_id.json +0 -1
- data/spec/cassettes/Tacokit_Client_Webhooks/_create_webhook/creates_a_webhook.json +0 -1
- data/spec/cassettes/Tacokit_Client_Webhooks/_delete_webhook/deletes_a_webhook.json +0 -1
- data/spec/cassettes/Tacokit_Client_Webhooks/_update_webhook/updates_a_webhook.json +0 -1
- data/spec/cassettes/Tacokit_Client_Webhooks/_webhook/returns_a_webhook_by_short_link.json +0 -1
- data/spec/fixtures/taco.png +0 -0
- data/spec/spec_helper.rb +0 -171
- data/spec/tacokit/authorization_spec.rb +0 -47
- data/spec/tacokit/client/actions_spec.rb +0 -137
- data/spec/tacokit/client/boards_spec.rb +0 -171
- data/spec/tacokit/client/cards_spec.rb +0 -446
- data/spec/tacokit/client/checklists_spec.rb +0 -89
- data/spec/tacokit/client/labels_spec.rb +0 -62
- data/spec/tacokit/client/lists_spec.rb +0 -131
- data/spec/tacokit/client/members_spec.rb +0 -145
- data/spec/tacokit/client/notifications_spec.rb +0 -25
- data/spec/tacokit/client/organizations_spec.rb +0 -79
- data/spec/tacokit/client/searches_spec.rb +0 -11
- data/spec/tacokit/client/tokens_spec.rb +0 -33
- data/spec/tacokit/client/types_spec.rb +0 -11
- data/spec/tacokit/client/webhooks_spec.rb +0 -61
- data/spec/tacokit/client_spec.rb +0 -28
- data/spec/tacokit/configuration_spec.rb +0 -50
- data/spec/tacokit/middleware/raise_error_spec.rb +0 -34
- data/spec/tacokit/resource_spec.rb +0 -151
- data/spec/tacokit/transform_spec.rb +0 -133
- data/spec/tacokit_spec.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f04b3d5706a939e80215228ad9189924458855ad
|
4
|
+
data.tar.gz: bbb0d40148e65c9b4a3b08d758088dc3c54448ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d02daaf1940fd81848461fc0b549f11c485365111a1c79cd390e522028572551cc422bc08fda9491cd53fb87e07eb32629a09310a897fe553c511e7204ad5b32
|
7
|
+
data.tar.gz: 035b1be4fd4623497df3c3f55ba4cff1636fa0eec5a0be68648945d245e505b76e0df19cc33d080508e4cea77d25e22bd85c45e807350ba8eb549382d218fae5
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -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
|
|
data/.travis.yml
CHANGED
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]
|
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
|
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
|
-
|
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
|
-
|
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
|
-
```
|
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
|
-
|
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
|
-
|
149
|
+
# retrieve boards for client account
|
150
|
+
boards = client.boards
|
142
151
|
# => [{:id=>"54...", :name=>"Work in Progress", ... }, {...}]
|
143
152
|
|
144
|
-
|
153
|
+
# retrieve board for user 'rossta'
|
154
|
+
boards = client.boards("rossta")
|
145
155
|
# => [{:id=>"32...", :name=>"Tacokit Ideas", ... }, {...}]
|
146
156
|
|
147
|
-
|
157
|
+
# change board attributes
|
158
|
+
board = client.update_board(board, name: "TODO")
|
148
159
|
# => {:id=>"54...", :name=>"TODO", ... }
|
149
160
|
|
150
|
-
|
151
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
169
|
-
#
|
182
|
+
```ruby
|
183
|
+
# retrieve card by card id
|
184
|
+
card = client.card(card_id)
|
185
|
+
# => {:id# =>"12...", :name# =>"Call Mom", ... }
|
170
186
|
|
171
|
-
|
172
|
-
|
187
|
+
# access card attributes by message sending
|
188
|
+
card.name
|
189
|
+
# => "Call wife"
|
173
190
|
|
174
|
-
|
175
|
-
|
191
|
+
# change card attributes
|
192
|
+
card = client.update_card(card, name: "Wish List")
|
193
|
+
# => {:id# =>"12...", :name# =>"Wish List", ... }
|
176
194
|
|
177
|
-
|
195
|
+
# move card to another list
|
196
|
+
client.move_card(card, list_id: list_id)
|
178
197
|
|
179
|
-
|
198
|
+
# retrieve members assigned to card
|
199
|
+
client.card_members(card)
|
180
200
|
|
181
|
-
|
201
|
+
# attach by url or file path
|
202
|
+
client.attach_file(card, "https://pbs.twimg.com/media/CCKtnZmUsAEUAX2.jpg:large")
|
182
203
|
|
183
|
-
|
204
|
+
# add comment to a card
|
205
|
+
client.add_comment(card, "Nice jorb!")
|
184
206
|
|
185
|
-
|
207
|
+
# receive notifications for card updates
|
208
|
+
client.subscribe_to_card(card)
|
186
209
|
|
187
|
-
|
210
|
+
# send card into the abyss
|
211
|
+
client.archive_card(card)
|
188
212
|
|
189
|
-
|
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
|
-
|
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
|
-
|
202
|
-
|
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
|
-
|
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
|
-
|
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
|
data/bin/_guard-core
ADDED
@@ -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")
|
data/bin/console
ADDED
data/bin/guard
ADDED
@@ -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")
|
data/bin/rake
ADDED
@@ -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")
|
data/bin/rspec
ADDED
@@ -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")
|
data/bin/rubocop
ADDED
@@ -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")
|