wetransfer 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60a6b133bf3e99a084dd9b480df89119d63d4edb
|
4
|
+
data.tar.gz: 3a8ee6107e57abbeab3e65406a92acaea0c89826
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb766106e8761c83f2983e5a2661051f486007e33d66933991037e73e48420c48e9bbec28e2513a257cf892c03a8db3e0662fca62f67684a7581cb3376ea80bd
|
7
|
+
data.tar.gz: 82b70497540b93f0d737fb3070e969651f8b27f13e3e12a2ec3237a55bc3f5497dcab182dae74a5fecbdd201e317aa1dcfe34e8ed4debdd2689fdceb11c1be66
|
data/README.md
CHANGED
@@ -68,7 +68,7 @@ transfer = @client.create_transfer(name: "My wonderful transfer", description: "
|
|
68
68
|
upload.add_file_at(path: '/path/to/local/file.jpg')
|
69
69
|
upload.add_file_at(path: '/path/to/another/local/file.jpg')
|
70
70
|
upload.add_file(name: 'README.txt', io: StringIO.new("This is the contents of the file"))
|
71
|
-
upload.add_web_content(
|
71
|
+
upload.add_web_content(url: "https://www.the.url.you.want.to.share.com"))
|
72
72
|
end
|
73
73
|
|
74
74
|
transfer.shortened_url => "https://we.tl/SSBsb3ZlIHJ1Ynk="
|
@@ -16,10 +16,8 @@ class TransferBuilder
|
|
16
16
|
add_file(name: File.basename(path), io: File.open(path, 'rb'))
|
17
17
|
end
|
18
18
|
|
19
|
-
def add_web_content(
|
20
|
-
|
21
|
-
url_title = url.split('/').last
|
22
|
-
@items << FutureWebItem.new(url: url, title: url_title)
|
19
|
+
def add_web_content(url:)
|
20
|
+
@items << FutureWebItem.new(url: url, title: url)
|
23
21
|
true
|
24
22
|
end
|
25
23
|
|
data/spec/integration_spec.rb
CHANGED
@@ -97,7 +97,7 @@ describe WeTransferClient do
|
|
97
97
|
client = WeTransferClient.new(api_key: ENV.fetch('WT_API_KEY'), logger: test_logger)
|
98
98
|
transfer = client.create_transfer(name: 'My collection of web content', description: 'link collection') do |builder|
|
99
99
|
10.times do
|
100
|
-
builder.add_web_content(
|
100
|
+
builder.add_web_content(url: 'https://www.wetransfer.com')
|
101
101
|
end
|
102
102
|
end
|
103
103
|
expect(transfer).to be_kind_of(RemoteTransfer)
|
@@ -135,7 +135,7 @@ describe WeTransferClient do
|
|
135
135
|
expect(add_result).to eq(true)
|
136
136
|
|
137
137
|
# add url to transfer
|
138
|
-
add_result = builder.add_web_content(
|
138
|
+
add_result = builder.add_web_content(url: 'http://www.wetransfer.com')
|
139
139
|
expect(add_result).to eq(true)
|
140
140
|
end
|
141
141
|
|
@@ -29,12 +29,12 @@ describe TransferBuilder do
|
|
29
29
|
|
30
30
|
it 'should add a url' do
|
31
31
|
transfer_builder = described_class.new
|
32
|
-
transfer_builder.add_web_content(
|
32
|
+
transfer_builder.add_web_content(url: 'https://www.wetransfer.com/')
|
33
33
|
expect(transfer_builder.items.count).to eq(1)
|
34
34
|
|
35
35
|
item = transfer_builder.items.first
|
36
|
-
expect(item.url).to eq('https://wetransfer.com/')
|
37
|
-
expect(item.title).to eq('wetransfer.com')
|
36
|
+
expect(item.url).to eq('https://www.wetransfer.com/')
|
37
|
+
expect(item.title).to eq('https://www.wetransfer.com/')
|
38
38
|
expect(item.local_identifier).to be_kind_of(String)
|
39
39
|
end
|
40
40
|
end
|