ruby-trello 4.0.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/trello/action.rb +8 -8
- data/lib/trello/board.rb +2 -2
- data/lib/trello/card.rb +12 -11
- data/lib/trello/comment.rb +6 -6
- data/lib/trello/net/faraday.rb +31 -0
- data/lib/trello/net/rest_client.rb +4 -0
- data/lib/trello/net.rb +4 -0
- data/lib/trello/notification.rb +10 -10
- data/lib/trello/organization.rb +2 -2
- data/spec/action_spec.rb +4 -4
- data/spec/association_spec.rb +1 -1
- data/spec/board_spec.rb +1 -1
- data/spec/card_spec.rb +6 -6
- data/spec/cassettes/can_add_a_file_on_a_card_with_farady.yml +244 -0
- data/spec/cassettes/can_get_boards_of_organization.yml +105 -84
- data/spec/cassettes/can_get_boards_with_filter_of_organization.yml +222 -0
- data/spec/integration/card/add_and_remove_attachment_spec.rb +2 -1
- data/spec/integration/organization/associations/boards_spec.rb +22 -0
- data/spec/notification_spec.rb +5 -5
- metadata +40 -2
@@ -0,0 +1,222 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.trello.com/1/organizations/5e93ba154634282b6df23bcc?key=DEVELOPER_PUBLIC_KEY&token=MEMBER_TOKEN
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v2.7.11
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Thu, 21 Dec 2023 16:37:16 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
Content-Length:
|
26
|
+
- '337'
|
27
|
+
Referrer-Policy:
|
28
|
+
- strict-origin-when-cross-origin
|
29
|
+
X-Dns-Prefetch-Control:
|
30
|
+
- 'off'
|
31
|
+
X-Download-Options:
|
32
|
+
- noopen
|
33
|
+
X-Frame-Options:
|
34
|
+
- DENY
|
35
|
+
X-Permitted-Cross-Domain-Policies:
|
36
|
+
- none
|
37
|
+
Surrogate-Control:
|
38
|
+
- no-store
|
39
|
+
Cache-Control:
|
40
|
+
- max-age=0, must-revalidate, no-cache, no-store
|
41
|
+
Pragma:
|
42
|
+
- no-cache
|
43
|
+
Expires:
|
44
|
+
- Thu, 01 Jan 1970 00:00:00
|
45
|
+
X-Trello-Version:
|
46
|
+
- 1.249073.0
|
47
|
+
X-Trello-Environment:
|
48
|
+
- Production
|
49
|
+
Set-Cookie:
|
50
|
+
- dsc=set_cookie_dsc; Path=/; Expires=Thu, 04 Jan 2024 16:37:16 GMT; Secure;
|
51
|
+
SameSite=None
|
52
|
+
- preAuthProps=s%3A5e679b808e6e8828784b30e1%3AisEnterpriseAdmin%3Dfalse.Pfv1AFghhSOM0MLjFpWB8CaOPcNRIjt%2FmCZysEK4KNY;
|
53
|
+
Path=/; Expires=Thu, 28 Dec 2023 16:37:16 GMT; HttpOnly
|
54
|
+
Access-Control-Allow-Origin:
|
55
|
+
- "*"
|
56
|
+
Access-Control-Allow-Methods:
|
57
|
+
- GET, PUT, POST, DELETE
|
58
|
+
Access-Control-Allow-Headers:
|
59
|
+
- Authorization, Accept, Content-Type
|
60
|
+
Access-Control-Expose-Headers:
|
61
|
+
- x-rate-limit-api-key-interval-ms, x-rate-limit-api-key-max, x-rate-limit-api-key-remaining,
|
62
|
+
x-rate-limit-api-token-interval-ms, x-rate-limit-api-token-max, x-rate-limit-api-token-remaining
|
63
|
+
X-Rate-Limit-Api-Token-Interval-Ms:
|
64
|
+
- '10000'
|
65
|
+
X-Rate-Limit-Api-Token-Max:
|
66
|
+
- '100'
|
67
|
+
X-Rate-Limit-Api-Token-Remaining:
|
68
|
+
- '99'
|
69
|
+
X-Rate-Limit-Db-Query-Time-Interval-Ms:
|
70
|
+
- '600000'
|
71
|
+
X-Rate-Limit-Db-Query-Time-Max:
|
72
|
+
- '7200000'
|
73
|
+
X-Rate-Limit-Db-Query-Time-Remaining:
|
74
|
+
- '7199990'
|
75
|
+
X-Rate-Limit-Api-Key-Interval-Ms:
|
76
|
+
- '10000'
|
77
|
+
X-Rate-Limit-Api-Key-Max:
|
78
|
+
- '300'
|
79
|
+
X-Rate-Limit-Api-Key-Remaining:
|
80
|
+
- '299'
|
81
|
+
X-Rate-Limit-Member-Interval-Ms:
|
82
|
+
- '10000'
|
83
|
+
X-Rate-Limit-Member-Max:
|
84
|
+
- '375'
|
85
|
+
X-Rate-Limit-Member-Remaining:
|
86
|
+
- '374'
|
87
|
+
X-Server-Time:
|
88
|
+
- '1703176636327'
|
89
|
+
Server:
|
90
|
+
- AtlassianEdge
|
91
|
+
X-Content-Type-Options:
|
92
|
+
- nosniff
|
93
|
+
X-Xss-Protection:
|
94
|
+
- 1; mode=block
|
95
|
+
Atl-Traceid:
|
96
|
+
- 86e444b4d8164c4cb68941786ec9ea47
|
97
|
+
Report-To:
|
98
|
+
- '{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group":
|
99
|
+
"endpoint-1", "include_subdomains": true, "max_age": 600}'
|
100
|
+
Nel:
|
101
|
+
- '{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to":
|
102
|
+
"endpoint-1"}'
|
103
|
+
Strict-Transport-Security:
|
104
|
+
- max-age=63072000; preload
|
105
|
+
body:
|
106
|
+
encoding: UTF-8
|
107
|
+
string: '{"id":"5e93ba154634282b6df23bcc","name":"integrationtest11","displayName":"Integration
|
108
|
+
Test 1","desc":"This is a team for doing integration tests","descData":null,"url":"https://trello.com/w/integrationtest11","website":null,"teamType":"engineering-it","logoHash":null,"logoUrl":null,"offering":"trello.free","products":[],"powerUps":[]}'
|
109
|
+
recorded_at: Thu, 21 Dec 2023 16:37:16 GMT
|
110
|
+
- request:
|
111
|
+
method: get
|
112
|
+
uri: https://api.trello.com/1/organizations/5e93ba154634282b6df23bcc/boards?fields=id,name&filter=open&key=DEVELOPER_PUBLIC_KEY&token=MEMBER_TOKEN
|
113
|
+
body:
|
114
|
+
encoding: US-ASCII
|
115
|
+
string: ''
|
116
|
+
headers:
|
117
|
+
User-Agent:
|
118
|
+
- Faraday v2.7.11
|
119
|
+
Accept-Encoding:
|
120
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
121
|
+
Accept:
|
122
|
+
- "*/*"
|
123
|
+
response:
|
124
|
+
status:
|
125
|
+
code: 200
|
126
|
+
message: OK
|
127
|
+
headers:
|
128
|
+
Date:
|
129
|
+
- Thu, 21 Dec 2023 16:37:17 GMT
|
130
|
+
Content-Type:
|
131
|
+
- application/json; charset=utf-8
|
132
|
+
Content-Length:
|
133
|
+
- '390'
|
134
|
+
Referrer-Policy:
|
135
|
+
- strict-origin-when-cross-origin
|
136
|
+
X-Dns-Prefetch-Control:
|
137
|
+
- 'off'
|
138
|
+
X-Download-Options:
|
139
|
+
- noopen
|
140
|
+
X-Frame-Options:
|
141
|
+
- DENY
|
142
|
+
X-Permitted-Cross-Domain-Policies:
|
143
|
+
- none
|
144
|
+
Surrogate-Control:
|
145
|
+
- no-store
|
146
|
+
Cache-Control:
|
147
|
+
- max-age=0, must-revalidate, no-cache, no-store
|
148
|
+
Pragma:
|
149
|
+
- no-cache
|
150
|
+
Expires:
|
151
|
+
- Thu, 01 Jan 1970 00:00:00
|
152
|
+
X-Trello-Version:
|
153
|
+
- 1.249073.0
|
154
|
+
X-Trello-Environment:
|
155
|
+
- Production
|
156
|
+
Set-Cookie:
|
157
|
+
- dsc=set_cookie_dsc; Path=/; Expires=Thu, 04 Jan 2024 16:37:17 GMT; Secure;
|
158
|
+
SameSite=None
|
159
|
+
- preAuthProps=s%3A5e679b808e6e8828784b30e1%3AisEnterpriseAdmin%3Dfalse.Pfv1AFghhSOM0MLjFpWB8CaOPcNRIjt%2FmCZysEK4KNY;
|
160
|
+
Path=/; Expires=Thu, 28 Dec 2023 16:37:17 GMT; HttpOnly
|
161
|
+
Access-Control-Allow-Origin:
|
162
|
+
- "*"
|
163
|
+
Access-Control-Allow-Methods:
|
164
|
+
- GET, PUT, POST, DELETE
|
165
|
+
Access-Control-Allow-Headers:
|
166
|
+
- Authorization, Accept, Content-Type
|
167
|
+
Access-Control-Expose-Headers:
|
168
|
+
- x-rate-limit-api-key-interval-ms, x-rate-limit-api-key-max, x-rate-limit-api-key-remaining,
|
169
|
+
x-rate-limit-api-token-interval-ms, x-rate-limit-api-token-max, x-rate-limit-api-token-remaining
|
170
|
+
X-Rate-Limit-Api-Token-Interval-Ms:
|
171
|
+
- '10000'
|
172
|
+
X-Rate-Limit-Api-Token-Max:
|
173
|
+
- '100'
|
174
|
+
X-Rate-Limit-Api-Token-Remaining:
|
175
|
+
- '98'
|
176
|
+
X-Rate-Limit-Db-Query-Time-Interval-Ms:
|
177
|
+
- '600000'
|
178
|
+
X-Rate-Limit-Db-Query-Time-Max:
|
179
|
+
- '7200000'
|
180
|
+
X-Rate-Limit-Db-Query-Time-Remaining:
|
181
|
+
- '7199990'
|
182
|
+
X-Rate-Limit-Api-Key-Interval-Ms:
|
183
|
+
- '10000'
|
184
|
+
X-Rate-Limit-Api-Key-Max:
|
185
|
+
- '300'
|
186
|
+
X-Rate-Limit-Api-Key-Remaining:
|
187
|
+
- '298'
|
188
|
+
X-Rate-Limit-Member-Interval-Ms:
|
189
|
+
- '10000'
|
190
|
+
X-Rate-Limit-Member-Max:
|
191
|
+
- '375'
|
192
|
+
X-Rate-Limit-Member-Remaining:
|
193
|
+
- '373'
|
194
|
+
X-Server-Time:
|
195
|
+
- '1703176637457'
|
196
|
+
X-Trello-Actual-Fastget-Path:
|
197
|
+
- fast
|
198
|
+
Server:
|
199
|
+
- AtlassianEdge
|
200
|
+
X-Content-Type-Options:
|
201
|
+
- nosniff
|
202
|
+
X-Xss-Protection:
|
203
|
+
- 1; mode=block
|
204
|
+
Atl-Traceid:
|
205
|
+
- eaf61abfea77472fa7c51b033e902104
|
206
|
+
Report-To:
|
207
|
+
- '{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group":
|
208
|
+
"endpoint-1", "include_subdomains": true, "max_age": 600}'
|
209
|
+
Nel:
|
210
|
+
- '{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to":
|
211
|
+
"endpoint-1"}'
|
212
|
+
Strict-Transport-Security:
|
213
|
+
- max-age=63072000; preload
|
214
|
+
body:
|
215
|
+
encoding: UTF-8
|
216
|
+
string: '[{"id":"5ee65e305081b1306530df45","name":"IT 100"},{"id":"5ee65e31325f0d0a10726e6e","name":"IT
|
217
|
+
101"},{"id":"5e93ba98614ac22d22f085c4","name":"IT 2"},{"id":"5e94eaf386374970d06e4c89","name":"IT
|
218
|
+
3"},{"id":"5e94ee7357ac8a3edc2b2145","name":"IT 4"},{"id":"5e94f5ded016b22c2437c13c","name":"IT
|
219
|
+
5"},{"id":"5fa757c864083f6464d25346","name":"IT 6"},{"id":"5ee65f5fa64d6f2a7aee514c","name":"IT
|
220
|
+
99"}]'
|
221
|
+
recorded_at: Thu, 21 Dec 2023 16:37:17 GMT
|
222
|
+
recorded_with: VCR 6.0.0
|
@@ -7,7 +7,8 @@ RSpec.describe 'Trell::Card add and remove attachment' do
|
|
7
7
|
|
8
8
|
describe '#add_attachment' do
|
9
9
|
it 'can success add an attachment(file) on a card' do
|
10
|
-
|
10
|
+
cassette_name = Trello.http_client == "rest-client" ? "can_add_a_file_on_a_card" : "can_add_a_file_on_a_card_with_farady"
|
11
|
+
VCR.use_cassette(cassette_name) do
|
11
12
|
card = Trello::Card.find('5e95d1b4f43f9a06497f17f7')
|
12
13
|
file = File.new('spec/integration/card/add_and_remove_attachment_spec.rb', 'r')
|
13
14
|
|
@@ -12,6 +12,28 @@ RSpec.describe 'Trello::Organization#boards' do
|
|
12
12
|
|
13
13
|
expect(boards).to be_a(Array)
|
14
14
|
expect(boards[0]).to be_a(Trello::Board)
|
15
|
+
boards.each do |board|
|
16
|
+
expect(board.id).not_to be_nil
|
17
|
+
expect(board.name).not_to be_nil
|
18
|
+
expect(board.pinned).not_to be_nil
|
19
|
+
expect(board.url).not_to be_nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'can get boards with filter and specific fields' do
|
25
|
+
VCR.use_cassette('can_get_boards_with_filter_of_organization') do
|
26
|
+
organization = Trello::Organization.find('5e93ba154634282b6df23bcc')
|
27
|
+
boards = organization.boards(filter: "open", fields: "id,name")
|
28
|
+
|
29
|
+
expect(boards).to be_a(Array)
|
30
|
+
expect(boards[0]).to be_a(Trello::Board)
|
31
|
+
boards.each do |board|
|
32
|
+
expect(board.id).not_to be_nil
|
33
|
+
expect(board.name).not_to be_nil
|
34
|
+
expect(board.pinned).to be_nil
|
35
|
+
expect(board.url).to be_nil
|
36
|
+
end
|
15
37
|
end
|
16
38
|
end
|
17
39
|
|
data/spec/notification_spec.rb
CHANGED
@@ -37,7 +37,7 @@ module Trello
|
|
37
37
|
it "can retrieve the board" do
|
38
38
|
allow(client)
|
39
39
|
.to receive(:get)
|
40
|
-
.with("/notifications/#{notification_details['id']}/board")
|
40
|
+
.with("/notifications/#{notification_details['id']}/board", {})
|
41
41
|
.and_return JSON.generate(boards_details.first)
|
42
42
|
|
43
43
|
expect(notification.board.id).to eq boards_details.first['id']
|
@@ -48,7 +48,7 @@ module Trello
|
|
48
48
|
it "can retrieve the list" do
|
49
49
|
allow(client)
|
50
50
|
.to receive(:get)
|
51
|
-
.with("/notifications/#{notification_details['id']}/list")
|
51
|
+
.with("/notifications/#{notification_details['id']}/list", {})
|
52
52
|
.and_return JSON.generate(lists_details.first)
|
53
53
|
|
54
54
|
expect(notification.list.id).to eq lists_details.first['id']
|
@@ -59,7 +59,7 @@ module Trello
|
|
59
59
|
it "can retrieve the card" do
|
60
60
|
allow(client)
|
61
61
|
.to receive(:get)
|
62
|
-
.with("/notifications/#{notification_details['id']}/card")
|
62
|
+
.with("/notifications/#{notification_details['id']}/card", {})
|
63
63
|
.and_return JSON.generate(cards_details.first)
|
64
64
|
|
65
65
|
expect(notification.card.id).to eq cards_details.first['id']
|
@@ -70,7 +70,7 @@ module Trello
|
|
70
70
|
it "can retrieve the member" do
|
71
71
|
allow(client)
|
72
72
|
.to receive(:get)
|
73
|
-
.with("/notifications/#{notification_details['id']}/member")
|
73
|
+
.with("/notifications/#{notification_details['id']}/member", {})
|
74
74
|
.and_return user_payload
|
75
75
|
|
76
76
|
expect(notification.member.id).to eq user_details['id']
|
@@ -90,7 +90,7 @@ module Trello
|
|
90
90
|
it "can retrieve the organization" do
|
91
91
|
allow(client)
|
92
92
|
.to receive(:get)
|
93
|
-
.with("/notifications/#{notification_details['id']}/organization")
|
93
|
+
.with("/notifications/#{notification_details['id']}/organization", {})
|
94
94
|
.and_return JSON.generate(orgs_details.first)
|
95
95
|
|
96
96
|
expect(notification.organization.id).to eq orgs_details.first['id']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-trello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Tregunna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -80,6 +80,40 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faraday-multipart
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mime-types
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
104
|
+
- - "<"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '4.0'
|
107
|
+
type: :runtime
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '3.0'
|
114
|
+
- - "<"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '4.0'
|
83
117
|
description: A wrapper around the trello.com API.
|
84
118
|
email: jeremy@tregunna.ca
|
85
119
|
executables: []
|
@@ -158,6 +192,7 @@ files:
|
|
158
192
|
- spec/cassettes/board_find_with_id_and_get_specific_fields.yml
|
159
193
|
- spec/cassettes/can_add_a_file_from_url_on_a_card.yml
|
160
194
|
- spec/cassettes/can_add_a_file_on_a_card.yml
|
195
|
+
- spec/cassettes/can_add_a_file_on_a_card_with_farady.yml
|
161
196
|
- spec/cassettes/can_add_a_member_to_a_board.yml
|
162
197
|
- spec/cassettes/can_add_a_member_to_a_card.yml
|
163
198
|
- spec/cassettes/can_add_label_on_a_card.yml
|
@@ -172,6 +207,7 @@ files:
|
|
172
207
|
- spec/cassettes/can_get_boards_of_custom_field.yml
|
173
208
|
- spec/cassettes/can_get_boards_of_label.yml
|
174
209
|
- spec/cassettes/can_get_boards_of_organization.yml
|
210
|
+
- spec/cassettes/can_get_boards_with_filter_of_organization.yml
|
175
211
|
- spec/cassettes/can_get_cards_of_board.yml
|
176
212
|
- spec/cassettes/can_get_cards_of_list.yml
|
177
213
|
- spec/cassettes/can_get_cards_of_member.yml
|
@@ -465,6 +501,7 @@ test_files:
|
|
465
501
|
- spec/cassettes/board_find_with_id_and_get_specific_fields.yml
|
466
502
|
- spec/cassettes/can_add_a_file_from_url_on_a_card.yml
|
467
503
|
- spec/cassettes/can_add_a_file_on_a_card.yml
|
504
|
+
- spec/cassettes/can_add_a_file_on_a_card_with_farady.yml
|
468
505
|
- spec/cassettes/can_add_a_member_to_a_board.yml
|
469
506
|
- spec/cassettes/can_add_a_member_to_a_card.yml
|
470
507
|
- spec/cassettes/can_add_label_on_a_card.yml
|
@@ -479,6 +516,7 @@ test_files:
|
|
479
516
|
- spec/cassettes/can_get_boards_of_custom_field.yml
|
480
517
|
- spec/cassettes/can_get_boards_of_label.yml
|
481
518
|
- spec/cassettes/can_get_boards_of_organization.yml
|
519
|
+
- spec/cassettes/can_get_boards_with_filter_of_organization.yml
|
482
520
|
- spec/cassettes/can_get_cards_of_board.yml
|
483
521
|
- spec/cassettes/can_get_cards_of_list.yml
|
484
522
|
- spec/cassettes/can_get_cards_of_member.yml
|