uploadfuse 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65382f39e78ba8480a5b5403c599633f9bf238a02580b3bbfb54514096295eb5
4
- data.tar.gz: 44b861f3e0769e731549ed3ca079d1708a086e83a592e73a3970da67308e2d41
3
+ metadata.gz: 06bf922e554926e149b2820da83614ecdcfca08775e9b1940fe8e71d8e5e4bf1
4
+ data.tar.gz: ba351c55d59d32c320abb6dd0819360d28e77222af54696b0b1b575fbaea1eed
5
5
  SHA512:
6
- metadata.gz: 9c112f7517c0ba60c48b76ca535d339f3e4fccff8a2d0012696d03616be5443239e1cc34ff7224f74b509b6b8e39dcb6eb9c870e741167be5e06fb80620bc531
7
- data.tar.gz: b5a8de54ea6f2e657dc05104d715b36353783ba15606b83eb9a1cc15fd8c7dd69821abf7118db4f39608e4c4401b1c528813b53c5975867e2162730fcadd4bba
6
+ metadata.gz: 8469ea05b071a0b36af9cd27fcce51da6473a3096bc5288ca552fc5dcf09e87de00e850852009b64c30932e9b8742be2a1ad8f2e41dbd6bb62e761339f487cc6
7
+ data.tar.gz: 51e7aafba095e003bd0b6d197a7629b0072807ed2bb68ce612f73b45035156bc038f35a6cd7402936a23fe95a5d751ad346b5312f8e9b3585e484072f73783b2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uploadfuse (0.1.0)
4
+ uploadfuse (0.1.1)
5
5
  faraday (~> 2.0)
6
6
  faraday-multipart (~> 1.0)
7
7
  marcel (~> 1.0)
data/README.md CHANGED
@@ -33,7 +33,8 @@ Firstly you'll need to create an API Access Token on your bucket page.
33
33
  #=> #<UploadFuse::Upload token="abc123fb...
34
34
 
35
35
  # Upload a file
36
- @client.uploads.create_from_file file: File.new("myfile.jpg")
36
+ # file_name is optional
37
+ @client.uploads.create_from_file file: File.new("myfile.jpg"), file_name: "other-file-name.jpg"
37
38
  #=> #<UploadFuse::Upload token="63a3f8fb...
38
39
 
39
40
  # Upload a file from a URL
@@ -11,12 +11,12 @@ module UploadFuse
11
11
  Upload.new(response.body["data"]) if response.success?
12
12
  end
13
13
 
14
- def create_from_file(file:)
14
+ def create_from_file(file:, file_name: nil)
15
15
  content_type = Marcel::MimeType.for file
16
16
 
17
17
  # This method uses Faraday Multipart (lostisland/faraday-multipart)
18
18
  payload = {}
19
- payload[:file] = Faraday::Multipart::FilePart.new(file, content_type)
19
+ payload[:file] = Faraday::Multipart::FilePart.new(file, content_type, file_name)
20
20
 
21
21
  response = client.connection_upload.post "uploads", payload
22
22
  Upload.new(JSON.parse(response.body)["data"]) if response.success?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UploadFuse
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uploadfuse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry