ruby-trello 3.2.0 → 4.1.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 +14 -19
- data/lib/trello/card.rb +1 -1
- 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.rb +2 -2
- data/spec/card_spec.rb +1 -1
- data/spec/cassettes/can_add_a_file_on_a_card_with_farady.yml +244 -0
- data/spec/integration/card/add_and_remove_attachment_spec.rb +2 -1
- data/spec/spec_helper.rb +2 -3
- metadata +44 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0b194ee4ee89c070fb0114b73ce3284368c98f5053555e1a3840a23f8d478b7
|
4
|
+
data.tar.gz: 8d1f2ccee4d1e694d8d49b7428ad5e2e0d4a4cdacf713c7edbd86f7782bb07fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afb77d7aafa9cee6c727997864b9d009ae31d679a8e5ae1d5d4c2699b61dd27f99f21a1a13196ad3003c4222b926e4b4822dc11cedd1997bf52ae2e35e2ff474
|
7
|
+
data.tar.gz: '039ec7a24b9efa6445138ad0fb7072cb5acfdfc40edf7e9bc383959e3bdcf8ca30e80efee66be088a15008b2456e53b663cfab4666eecce79c3243356d468db4'
|
data/README.md
CHANGED
@@ -15,22 +15,17 @@ to, please just [create an issue](https://github.com/jeremytregunna/ruby-trello/
|
|
15
15
|
|
16
16
|
## Requirements
|
17
17
|
|
18
|
-
| Ruby \ ActiveModel |
|
19
|
-
| ---- | ---- | ---- | ---- |
|
20
|
-
| 2.
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Use
|
28
|
-
|
29
|
-
Use version 2.2.1 or earlier for Ruby 2.1 ~ 2.4 support.
|
30
|
-
|
31
|
-
Use version 1.3.0 or earlier for Ruby 1.9.3 support.
|
32
|
-
|
33
|
-
Use version 1.4.x or earlier for Ruby 2.0.0 support.
|
18
|
+
| Ruby \ ActiveModel | 6.0 | 6.1 | 7.0 |
|
19
|
+
| ---- | ---- | ---- | ---- |
|
20
|
+
| 2.7 | ✅ | ✅ | ✅ |
|
21
|
+
| 3.0 | ✅ | ✅ | ✅ |
|
22
|
+
| 3.1 | ✅ | ✅ | ✅ |
|
23
|
+
|
24
|
+
- Use the newest version for Ruby 2.7.0 or newer support.
|
25
|
+
- Use version 3.2.0 or earlier for Ruby 2.5 ~ 2.6 support.
|
26
|
+
- Use version 2.2.1 or earlier for Ruby 2.1 ~ 2.4 support.
|
27
|
+
- Use version 1.3.0 or earlier for Ruby 1.9.3 support.
|
28
|
+
- Use version 1.4.x or earlier for Ruby 2.0.0 support.
|
34
29
|
|
35
30
|
## Installation
|
36
31
|
|
@@ -89,13 +84,13 @@ All the calls this library makes to Trello require authentication using these ke
|
|
89
84
|
|
90
85
|
#### HTTP Client
|
91
86
|
|
92
|
-
|
87
|
+
ruby-trello requires either [rest-client](https://rubygems.org/gems/rest-client) or [faraday](https://rubygems.org/gems/faraday) to be present for network calls. You can configure ruby-trello to use either one, depending on your project's needs. If both are present, ruby-trello defaults to using faraday.
|
93
88
|
|
94
89
|
```ruby
|
95
90
|
Trello.configure do |config|
|
96
|
-
config.http_client = 'rest-client'
|
97
|
-
# OR
|
98
91
|
config.http_client = 'faraday'
|
92
|
+
# OR
|
93
|
+
config.http_client = 'rest-client'
|
99
94
|
end
|
100
95
|
```
|
101
96
|
|
data/lib/trello/card.rb
CHANGED
@@ -273,7 +273,7 @@ module Trello
|
|
273
273
|
# Is it a file object or a string (url)?
|
274
274
|
if attachment.respond_to?(:path) && attachment.respond_to?(:read)
|
275
275
|
client.post("/cards/#{id}/attachments", {
|
276
|
-
file: attachment,
|
276
|
+
file: Trello::TInternet.multipart_file(attachment),
|
277
277
|
name: name
|
278
278
|
})
|
279
279
|
else
|
data/lib/trello/net/faraday.rb
CHANGED
@@ -4,6 +4,8 @@ module Trello
|
|
4
4
|
class << self
|
5
5
|
begin
|
6
6
|
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'mime/types'
|
7
9
|
rescue LoadError
|
8
10
|
end
|
9
11
|
|
@@ -11,6 +13,14 @@ module Trello
|
|
11
13
|
try_execute request
|
12
14
|
end
|
13
15
|
|
16
|
+
def multipart_file(file)
|
17
|
+
Faraday::Multipart::FilePart.new(
|
18
|
+
file,
|
19
|
+
content_type(file),
|
20
|
+
filename(file)
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
14
24
|
private
|
15
25
|
|
16
26
|
def try_execute(request)
|
@@ -33,6 +43,7 @@ module Trello
|
|
33
43
|
request: { timeout: 10 }
|
34
44
|
) do |faraday|
|
35
45
|
faraday.response :raise_error
|
46
|
+
faraday.request :multipart
|
36
47
|
faraday.request :json
|
37
48
|
end
|
38
49
|
|
@@ -40,6 +51,26 @@ module Trello
|
|
40
51
|
req.body = request.body
|
41
52
|
end
|
42
53
|
end
|
54
|
+
|
55
|
+
def content_type(file)
|
56
|
+
return file.content_type if file.respond_to?(:content_type)
|
57
|
+
|
58
|
+
mime = MIME::Types.type_for file.path
|
59
|
+
if mime.empty?
|
60
|
+
'text/plain'
|
61
|
+
else
|
62
|
+
mime[0].content_type
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def filename(file)
|
67
|
+
if file.respond_to?(:original_filename)
|
68
|
+
file.original_filename
|
69
|
+
else
|
70
|
+
File.basename(file.path)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
43
74
|
end
|
44
75
|
end
|
45
76
|
end
|
data/lib/trello/net.rb
CHANGED
data/lib/trello.rb
CHANGED
@@ -122,7 +122,7 @@ module Trello
|
|
122
122
|
end
|
123
123
|
|
124
124
|
# The order in which we will try the http clients
|
125
|
-
HTTP_CLIENT_PRIORITY = %w(rest-client
|
125
|
+
HTTP_CLIENT_PRIORITY = %w(faraday rest-client)
|
126
126
|
HTTP_CLIENTS = {
|
127
127
|
'faraday' => Trello::TFaraday::TInternet,
|
128
128
|
'rest-client' => Trello::TRestClient::TInternet
|
@@ -141,7 +141,7 @@ module Trello
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
raise ConfigurationError, 'Trello requires either rest-client
|
144
|
+
raise ConfigurationError, 'Trello requires either faraday or rest-client installed' unless client
|
145
145
|
|
146
146
|
client
|
147
147
|
end
|
data/spec/card_spec.rb
CHANGED
@@ -734,7 +734,7 @@ module Trello
|
|
734
734
|
|
735
735
|
allow(client)
|
736
736
|
.to receive(:post)
|
737
|
-
.with("/cards/abcdef123456789123456789/attachments", { file:
|
737
|
+
.with("/cards/abcdef123456789123456789/attachments", { file: instance_of(Multipart::Post::UploadIO), name: '' })
|
738
738
|
.and_return "not important"
|
739
739
|
|
740
740
|
card.add_attachment(f)
|
@@ -0,0 +1,244 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.trello.com/1/cards/5e95d1b4f43f9a06497f17f7?key=DEVELOPER_PUBLIC_KEY&token=MEMBER_TOKEN
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v2.3.0
|
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
|
+
- Sat, 11 Nov 2023 18:18:11 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
Content-Length:
|
26
|
+
- '1053'
|
27
|
+
X-Dns-Prefetch-Control:
|
28
|
+
- 'off'
|
29
|
+
Expect-Ct:
|
30
|
+
- max-age=0
|
31
|
+
X-Frame-Options:
|
32
|
+
- DENY
|
33
|
+
X-Download-Options:
|
34
|
+
- noopen
|
35
|
+
X-Permitted-Cross-Domain-Policies:
|
36
|
+
- none
|
37
|
+
Referrer-Policy:
|
38
|
+
- strict-origin-when-cross-origin
|
39
|
+
Surrogate-Control:
|
40
|
+
- no-store
|
41
|
+
Cache-Control:
|
42
|
+
- max-age=0, must-revalidate, no-cache, no-store
|
43
|
+
Pragma:
|
44
|
+
- no-cache
|
45
|
+
Expires:
|
46
|
+
- Thu, 01 Jan 1970 00:00:00
|
47
|
+
X-Trello-Version:
|
48
|
+
- 1.242759.0
|
49
|
+
X-Trello-Environment:
|
50
|
+
- Production
|
51
|
+
Set-Cookie:
|
52
|
+
- dsc=set_cookie_dsc; Path=/; Expires=Sat, 25 Nov 2023 18:18:11 GMT; Secure;
|
53
|
+
SameSite=None
|
54
|
+
- preAuthProps=s%3A5e679b808e6e8828784b30e1%3AisEnterpriseAdmin%3Dfalse.Pfv1AFghhSOM0MLjFpWB8CaOPcNRIjt%2FmCZysEK4KNY;
|
55
|
+
Path=/; HttpOnly
|
56
|
+
Access-Control-Allow-Origin:
|
57
|
+
- "*"
|
58
|
+
Access-Control-Allow-Methods:
|
59
|
+
- GET, PUT, POST, DELETE
|
60
|
+
Access-Control-Allow-Headers:
|
61
|
+
- Authorization, Accept, Content-Type
|
62
|
+
Access-Control-Expose-Headers:
|
63
|
+
- x-rate-limit-api-key-interval-ms, x-rate-limit-api-key-max, x-rate-limit-api-key-remaining,
|
64
|
+
x-rate-limit-api-token-interval-ms, x-rate-limit-api-token-max, x-rate-limit-api-token-remaining
|
65
|
+
X-Rate-Limit-Api-Token-Interval-Ms:
|
66
|
+
- '10000'
|
67
|
+
X-Rate-Limit-Api-Token-Max:
|
68
|
+
- '100'
|
69
|
+
X-Rate-Limit-Api-Token-Remaining:
|
70
|
+
- '99'
|
71
|
+
X-Rate-Limit-Db-Query-Time-Interval-Ms:
|
72
|
+
- '600000'
|
73
|
+
X-Rate-Limit-Db-Query-Time-Max:
|
74
|
+
- '7200000'
|
75
|
+
X-Rate-Limit-Db-Query-Time-Remaining:
|
76
|
+
- '7199990'
|
77
|
+
X-Rate-Limit-Api-Key-Interval-Ms:
|
78
|
+
- '10000'
|
79
|
+
X-Rate-Limit-Api-Key-Max:
|
80
|
+
- '300'
|
81
|
+
X-Rate-Limit-Api-Key-Remaining:
|
82
|
+
- '299'
|
83
|
+
X-Rate-Limit-Member-Interval-Ms:
|
84
|
+
- '10000'
|
85
|
+
X-Rate-Limit-Member-Max:
|
86
|
+
- '375'
|
87
|
+
X-Rate-Limit-Member-Remaining:
|
88
|
+
- '374'
|
89
|
+
X-Server-Time:
|
90
|
+
- '1699726691750'
|
91
|
+
Server:
|
92
|
+
- AtlassianEdge
|
93
|
+
X-Content-Type-Options:
|
94
|
+
- nosniff
|
95
|
+
X-Xss-Protection:
|
96
|
+
- 1; mode=block
|
97
|
+
Atl-Traceid:
|
98
|
+
- 5442e51c04ce42f5aa01bfb53445cc31
|
99
|
+
Report-To:
|
100
|
+
- '{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group":
|
101
|
+
"endpoint-1", "include_subdomains": true, "max_age": 600}'
|
102
|
+
Nel:
|
103
|
+
- '{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to":
|
104
|
+
"endpoint-1"}'
|
105
|
+
Strict-Transport-Security:
|
106
|
+
- max-age=63072000; preload
|
107
|
+
body:
|
108
|
+
encoding: UTF-8
|
109
|
+
string: '{"id":"5e95d1b4f43f9a06497f17f7","badges":{"attachmentsByType":{"trello":{"board":0,"card":0}},"location":false,"votes":0,"viewingMemberVoted":false,"subscribed":false,"start":null,"fogbugz":"","checkItems":0,"checkItemsChecked":0,"checkItemsEarliestDue":null,"comments":0,"attachments":3,"description":false,"due":null,"dueComplete":false},"checkItemStates":[],"closed":false,"dueComplete":false,"dateLastActivity":"2023-11-11T18:14:08.574Z","desc":"","descData":null,"due":null,"dueReminder":null,"email":null,"idBoard":"5e94f5ded016b22c2437c13c","idChecklists":[],"idList":"5e95d1b07f2ff83927319128","idMembers":[],"idMembersVoted":[],"idShort":2,"idAttachmentCover":"","labels":[],"idLabels":[],"manualCoverAttachment":false,"name":"C2","pos":16384,"shortLink":"DeJYDbq0","shortUrl":"https://trello.com/c/DeJYDbq0","start":null,"subscribed":false,"url":"https://trello.com/c/DeJYDbq0/2-c2","cover":{"idAttachment":null,"color":null,"idUploadedBackground":null,"size":"normal","brightness":"light","idPlugin":null},"isTemplate":false,"cardRole":null}'
|
110
|
+
recorded_at: Sat, 11 Nov 2023 18:18:11 GMT
|
111
|
+
- request:
|
112
|
+
method: post
|
113
|
+
uri: https://api.trello.com/1/cards/5e95d1b4f43f9a06497f17f7/attachments?key=DEVELOPER_PUBLIC_KEY&token=MEMBER_TOKEN
|
114
|
+
body:
|
115
|
+
encoding: UTF-8
|
116
|
+
string: "-------------RubyMultipartPost-045b3ab4e226f744d8d7119fa63ad0fb\r\nContent-Disposition:
|
117
|
+
form-data; name=\"file\"; filename=\"add_and_remove_attachment_spec.rb\"\r\nContent-Length:
|
118
|
+
1672\r\nContent-Type: application/x-ruby\r\nContent-Transfer-Encoding: binary\r\n\r\nrequire
|
119
|
+
'spec_helper'\n\nRSpec.describe 'Trell::Card add and remove attachment' do\n
|
120
|
+
\ include IntegrationHelpers\n\n before { setup_trello }\n\n describe '#add_attachment'
|
121
|
+
do\n it 'can success add an attachment(file) on a card', focus: true do\n
|
122
|
+
\ cassette_name = Trello.http_client == \"rest-client\" ? \"can_add_a_file_on_a_card\"
|
123
|
+
: \"can_add_a_file_on_a_card_with_farady\"\n VCR.use_cassette(cassette_name)
|
124
|
+
do\n card = Trello::Card.find('5e95d1b4f43f9a06497f17f7')\n file
|
125
|
+
= File.new('spec/integration/card/add_and_remove_attachment_spec.rb', 'r')\n\n
|
126
|
+
\ response = card.add_attachment(file)\n expect(response.code).to
|
127
|
+
eq(200)\n body = JSON.parse(response.body)\n expect(body['name']).to
|
128
|
+
eq('add_and_remove_attachment_spec.rb')\n end\n end\n\n it 'can
|
129
|
+
success add and attachment(url) on a card' do\n VCR.use_cassette('can_add_a_file_from_url_on_a_card')
|
130
|
+
do\n card = Trello::Card.find('5e95d1b4f43f9a06497f17f7')\n file_url
|
131
|
+
= 'https://upload.wikimedia.org/wikipedia/en/6/6b/Hello_Web_Series_%28Wordmark%29_Logo.png'\n\n
|
132
|
+
\ response = card.add_attachment(file_url, 'hello.png')\n expect(response.code).to
|
133
|
+
eq(200)\n body = JSON.parse(response.body)\n expect(body['name']).to
|
134
|
+
eq('hello.png')\n end\n end\n end\n\n describe '#remove_attachment'
|
135
|
+
do\n it 'can success remove and attachment on a card' do\n VCR.use_cassette('can_remove_an_attachment_on_a_card')
|
136
|
+
do\n card = Trello::Card.find('5e95d1b4f43f9a06497f17f7')\n attachments
|
137
|
+
= card.attachments\n\n response = card.remove_attachment(attachments.last)\n
|
138
|
+
\ expect(response.code).to eq(200)\n end\n end\n end\nend\n\r\n-------------RubyMultipartPost-045b3ab4e226f744d8d7119fa63ad0fb\r\nContent-Disposition:
|
139
|
+
form-data; name=\"name\"\r\n\r\n\r\n-------------RubyMultipartPost-045b3ab4e226f744d8d7119fa63ad0fb--\r\n"
|
140
|
+
headers:
|
141
|
+
User-Agent:
|
142
|
+
- Faraday v2.3.0
|
143
|
+
Content-Type:
|
144
|
+
- multipart/form-data; boundary=-----------RubyMultipartPost-045b3ab4e226f744d8d7119fa63ad0fb
|
145
|
+
Content-Length:
|
146
|
+
- '2104'
|
147
|
+
Accept-Encoding:
|
148
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
149
|
+
Accept:
|
150
|
+
- "*/*"
|
151
|
+
response:
|
152
|
+
status:
|
153
|
+
code: 200
|
154
|
+
message: OK
|
155
|
+
headers:
|
156
|
+
Date:
|
157
|
+
- Sat, 11 Nov 2023 18:18:14 GMT
|
158
|
+
Content-Type:
|
159
|
+
- application/json; charset=utf-8
|
160
|
+
Content-Length:
|
161
|
+
- '451'
|
162
|
+
X-Dns-Prefetch-Control:
|
163
|
+
- 'off'
|
164
|
+
Expect-Ct:
|
165
|
+
- max-age=0
|
166
|
+
X-Frame-Options:
|
167
|
+
- DENY
|
168
|
+
X-Download-Options:
|
169
|
+
- noopen
|
170
|
+
X-Permitted-Cross-Domain-Policies:
|
171
|
+
- none
|
172
|
+
Referrer-Policy:
|
173
|
+
- strict-origin-when-cross-origin
|
174
|
+
Surrogate-Control:
|
175
|
+
- no-store
|
176
|
+
Cache-Control:
|
177
|
+
- max-age=0, must-revalidate, no-cache, no-store
|
178
|
+
Pragma:
|
179
|
+
- no-cache
|
180
|
+
Expires:
|
181
|
+
- Thu, 01 Jan 1970 00:00:00
|
182
|
+
X-Trello-Version:
|
183
|
+
- 1.242759.0
|
184
|
+
X-Trello-Environment:
|
185
|
+
- Production
|
186
|
+
Access-Control-Allow-Origin:
|
187
|
+
- "*"
|
188
|
+
Access-Control-Allow-Methods:
|
189
|
+
- GET, PUT, POST, DELETE
|
190
|
+
Access-Control-Allow-Headers:
|
191
|
+
- Authorization, Accept, Content-Type
|
192
|
+
Access-Control-Expose-Headers:
|
193
|
+
- x-rate-limit-api-key-interval-ms, x-rate-limit-api-key-max, x-rate-limit-api-key-remaining,
|
194
|
+
x-rate-limit-api-token-interval-ms, x-rate-limit-api-token-max, x-rate-limit-api-token-remaining
|
195
|
+
X-Rate-Limit-Api-Token-Interval-Ms:
|
196
|
+
- '10000'
|
197
|
+
X-Rate-Limit-Api-Token-Max:
|
198
|
+
- '100'
|
199
|
+
X-Rate-Limit-Api-Token-Remaining:
|
200
|
+
- '98'
|
201
|
+
X-Rate-Limit-Db-Query-Time-Interval-Ms:
|
202
|
+
- '600000'
|
203
|
+
X-Rate-Limit-Db-Query-Time-Max:
|
204
|
+
- '7200000'
|
205
|
+
X-Rate-Limit-Db-Query-Time-Remaining:
|
206
|
+
- '7199990'
|
207
|
+
X-Rate-Limit-Api-Key-Interval-Ms:
|
208
|
+
- '10000'
|
209
|
+
X-Rate-Limit-Api-Key-Max:
|
210
|
+
- '300'
|
211
|
+
X-Rate-Limit-Api-Key-Remaining:
|
212
|
+
- '298'
|
213
|
+
X-Rate-Limit-Member-Interval-Ms:
|
214
|
+
- '10000'
|
215
|
+
X-Rate-Limit-Member-Max:
|
216
|
+
- '375'
|
217
|
+
X-Rate-Limit-Member-Remaining:
|
218
|
+
- '373'
|
219
|
+
Set-Cookie:
|
220
|
+
- preAuthProps=s%3A5e679b808e6e8828784b30e1%3AisEnterpriseAdmin%3Dfalse.Pfv1AFghhSOM0MLjFpWB8CaOPcNRIjt%2FmCZysEK4KNY;
|
221
|
+
Path=/; HttpOnly
|
222
|
+
X-Server-Time:
|
223
|
+
- '1699726694377'
|
224
|
+
Server:
|
225
|
+
- AtlassianEdge
|
226
|
+
X-Content-Type-Options:
|
227
|
+
- nosniff
|
228
|
+
X-Xss-Protection:
|
229
|
+
- 1; mode=block
|
230
|
+
Atl-Traceid:
|
231
|
+
- c52c43e2b82d4915bb527fc58f3153bc
|
232
|
+
Report-To:
|
233
|
+
- '{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group":
|
234
|
+
"endpoint-1", "include_subdomains": true, "max_age": 600}'
|
235
|
+
Nel:
|
236
|
+
- '{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to":
|
237
|
+
"endpoint-1"}'
|
238
|
+
Strict-Transport-Security:
|
239
|
+
- max-age=63072000; preload
|
240
|
+
body:
|
241
|
+
encoding: UTF-8
|
242
|
+
string: '{"id":"654fc566366a6de141e759d8","bytes":1672,"date":"2023-11-11T18:18:14.070Z","edgeColor":null,"idMember":"5e679b808e6e8828784b30e1","isUpload":true,"mimeType":"application/x-ruby","name":"add_and_remove_attachment_spec.rb","previews":[],"url":"https://trello.com/1/cards/5e95d1b4f43f9a06497f17f7/attachments/654fc566366a6de141e759d8/download/add_and_remove_attachment_spec.rb","pos":81920,"fileName":"add_and_remove_attachment_spec.rb","limits":{}}'
|
243
|
+
recorded_at: Sat, 11 Nov 2023 18:18:14 GMT
|
244
|
+
recorded_with: VCR 6.1.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
|
|
data/spec/spec_helper.rb
CHANGED
@@ -4,8 +4,7 @@ require 'trello'
|
|
4
4
|
require 'webmock/rspec'
|
5
5
|
require 'stringio'
|
6
6
|
require 'vcr'
|
7
|
-
|
8
|
-
require 'pry-byebug' if RUBY_ENGINE != 'jruby'
|
7
|
+
require 'pry-byebug'
|
9
8
|
|
10
9
|
VCR.configure do |config|
|
11
10
|
config.default_cassette_options = { match_requests_on: %i[uri method body] }
|
@@ -74,7 +73,7 @@ module IntegrationHelpers
|
|
74
73
|
Trello.configure do |config|
|
75
74
|
config.developer_public_key = ENV['TRELLO_DEVELOPER_PUBLIC_KEY'] || 'developerpublickey'
|
76
75
|
config.member_token = ENV['TRELLO_MEMBER_TOKEN'] || 'membertoken'
|
77
|
-
config.http_client = ENV['HTTP_CLIENT_GEM'] || '
|
76
|
+
config.http_client = ENV['HTTP_CLIENT_GEM'] || 'faraday'
|
78
77
|
end
|
79
78
|
end
|
80
79
|
end
|
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
|
+
version: 4.1.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-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 6.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: addressable
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,19 +67,53 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.4.5
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: faraday
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
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
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - ">="
|
74
102
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
103
|
+
version: '3.0'
|
104
|
+
- - "<"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '4.0'
|
76
107
|
type: :runtime
|
77
108
|
prerelease: false
|
78
109
|
version_requirements: !ruby/object:Gem::Requirement
|
79
110
|
requirements:
|
80
111
|
- - ">="
|
81
112
|
- !ruby/object:Gem::Version
|
82
|
-
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
|
@@ -441,7 +476,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
441
476
|
requirements:
|
442
477
|
- - ">="
|
443
478
|
- !ruby/object:Gem::Version
|
444
|
-
version: 2.
|
479
|
+
version: 2.7.0
|
445
480
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
446
481
|
requirements:
|
447
482
|
- - ">="
|
@@ -465,6 +500,7 @@ test_files:
|
|
465
500
|
- spec/cassettes/board_find_with_id_and_get_specific_fields.yml
|
466
501
|
- spec/cassettes/can_add_a_file_from_url_on_a_card.yml
|
467
502
|
- spec/cassettes/can_add_a_file_on_a_card.yml
|
503
|
+
- spec/cassettes/can_add_a_file_on_a_card_with_farady.yml
|
468
504
|
- spec/cassettes/can_add_a_member_to_a_board.yml
|
469
505
|
- spec/cassettes/can_add_a_member_to_a_card.yml
|
470
506
|
- spec/cassettes/can_add_label_on_a_card.yml
|