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: 6c3bcf1003d1940a7f374bc5e395ed0c0ed245c5
4
- data.tar.gz: 6a9d0d2dcb79b3d9645836a689af75f4623131e1
3
+ metadata.gz: 60a6b133bf3e99a084dd9b480df89119d63d4edb
4
+ data.tar.gz: 3a8ee6107e57abbeab3e65406a92acaea0c89826
5
5
  SHA512:
6
- metadata.gz: e8e7ce672d56cae479a45c2f8dc370f5a87515c4d55dae54ecd0106250d0d0e1d06b82e687a19dc376e24d0fd51b063d57d9a92815fdbcc4cad33fcae9fc60c7
7
- data.tar.gz: 3c3d91e6bab75ea66f4a79e3248b4363bffe1c08e0f3a798c24d7275eaf50a5a42067ef1b78bbfc7adcd2a2093d96898b07f84e1ea66ec7b0b96263443646fa6
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(path: "https://www.the.url.you.want.to.share.com"))
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(path:)
20
- url = open(path, allow_redirections: :safe).base_uri.to_s
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
 
@@ -1,3 +1,3 @@
1
1
  class WeTransferClient
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
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(path: 'https://www.wetransfer.com')
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(path: 'http://www.wetransfer.com')
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(path: 'https://www.wetransfer.com')
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
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.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman