wetransfer 0.4.1 → 0.4.2

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: 60a6b133bf3e99a084dd9b480df89119d63d4edb
4
- data.tar.gz: 3a8ee6107e57abbeab3e65406a92acaea0c89826
3
+ metadata.gz: ab826ed8a40904825cc771a81096be1faa229f3d
4
+ data.tar.gz: bbb35f3de5f2b7f85a6864f33d3d07366270784e
5
5
  SHA512:
6
- metadata.gz: eb766106e8761c83f2983e5a2661051f486007e33d66933991037e73e48420c48e9bbec28e2513a257cf892c03a8db3e0662fca62f67684a7581cb3376ea80bd
7
- data.tar.gz: 82b70497540b93f0d737fb3070e969651f8b27f13e3e12a2ec3237a55bc3f5497dcab182dae74a5fecbdd201e317aa1dcfe34e8ed4debdd2689fdceb11c1be66
6
+ metadata.gz: e80285c5222256824c55591db0acc9161ce1ad5ab78f84b1c15a165952681c59963261a0bbd23079453b63e73befd4b4b5c8753e2be0239717ae413b1cc3beb4
7
+ data.tar.gz: 7bdef21c4652477b276058c12add0a0a53167dc2781beceff3f8294f18e021568ee7696fad787ce701e2d2fc395d7e3d659728ea87eb53b9f56cdabb00fa58ae
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(url: "https://www.the.url.you.want.to.share.com"))
71
+ upload.add_web_url(url: "https://www.the.url.you.want.to.share.com", title: "title of the url"))
72
72
  end
73
73
 
74
74
  transfer.shortened_url => "https://we.tl/SSBsb3ZlIHJ1Ynk="
@@ -16,8 +16,9 @@ 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(url:)
20
- @items << FutureWebItem.new(url: url, title: url)
19
+ def add_web_url(url:, title: nil)
20
+ title ||= url
21
+ @items << FutureWebItem.new(url: url, title: title)
21
22
  true
22
23
  end
23
24
 
@@ -1,3 +1,3 @@
1
1
  class WeTransferClient
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
@@ -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(url: 'https://www.wetransfer.com')
100
+ builder.add_web_url(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(url: 'http://www.wetransfer.com')
138
+ add_result = builder.add_web_url(url: 'http://www.wetransfer.com', title: 'website used for file transfers')
139
139
  expect(add_result).to eq(true)
140
140
  end
141
141
 
@@ -29,12 +29,33 @@ 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(url: 'https://www.wetransfer.com/')
32
+ transfer_builder.add_web_url(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
36
  expect(item.url).to eq('https://www.wetransfer.com/')
37
+ expect(item.local_identifier).to be_kind_of(String)
38
+ end
39
+
40
+ it 'should user url for the title when none is given' do
41
+ transfer_builder = described_class.new
42
+ transfer_builder.add_web_url(url: 'https://www.wetransfer.com/')
43
+ expect(transfer_builder.items.count).to eq(1)
44
+
45
+ item = transfer_builder.items.first
46
+
37
47
  expect(item.title).to eq('https://www.wetransfer.com/')
38
48
  expect(item.local_identifier).to be_kind_of(String)
39
49
  end
50
+
51
+ it 'should pass title as webcontent title' do
52
+ transfer_builder = described_class.new
53
+ transfer_builder.add_web_url(url: 'https://www.wetransfer.com/', title: 'awesome website for file transfering')
54
+ expect(transfer_builder.items.count).to eq(1)
55
+
56
+ item = transfer_builder.items.first
57
+ expect(item.url).to eq('https://www.wetransfer.com/')
58
+ expect(item.title).to eq('awesome website for file transfering')
59
+ expect(item.local_identifier).to be_kind_of(String)
60
+ end
40
61
  end
@@ -27,11 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.bindir = 'exe'
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
- spec.post_install_message = %q{
31
- Warning: We have changed the syntax for the create_transfer method.
32
- create_transfer(title:, message:) is now create_transfer(name:, description:)
33
- Please update your usage accordingly. Thank you and our apologies for the disruption.
34
- }
35
30
 
36
31
  spec.add_dependency 'faraday', '~> 0.12'
37
32
  spec.add_dependency 'ks', '~> 0.0.1'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wetransfer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-06-27 00:00:00.000000000 Z
12
+ date: 2018-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -198,10 +198,7 @@ licenses:
198
198
  - MIT
199
199
  metadata:
200
200
  allowed_push_host: https://rubygems.org
201
- post_install_message: "\n Warning: We have changed the syntax for the create_transfer
202
- method.\n create_transfer(title:, message:) is now create_transfer(name:, description:)\n
203
- \ Please update your usage accordingly. Thank you and our apologies for the disruption.\n
204
- \ "
201
+ post_install_message:
205
202
  rdoc_options: []
206
203
  require_paths:
207
204
  - lib