carrierwave-sharefile 0.0.4 → 0.0.5

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: da7585d3732aaa098d8fe55d0628e0c68386a87a
4
- data.tar.gz: 947bb2de1e102a8713cdf176fecf5e93bd81a73a
3
+ metadata.gz: c9d3d778c5315ba5cef24d5ba56a2fe3c8101b3c
4
+ data.tar.gz: 12328b610a0e5c7c14be936d018a5bfea3102037
5
5
  SHA512:
6
- metadata.gz: f8c9ad62ccb90fd15e86fb9072f105f941ec1871618348fd884c1152e2c41327d2874ec95e04fa181590e2d0a21e41e5abdfe9cffe8868097e724c08aff9af2f
7
- data.tar.gz: 1e1e6bfb30e59b60ac463b88094a6b8fd81c813815cb9eb2aa7b1bf43547573618db5d35dfd51ed7a43654fe7f13aea6dd03eb3754364f762686aa5ec48ea0a4
6
+ metadata.gz: c6f57501158c8a9d0867bdaa596082778c31bf11d493d533b438321d8aa8db952102d88d8af918d9f0237a24108b020752dc6ce3b5d291e1361753fcb2de3acf
7
+ data.tar.gz: fb414c7aa99900b5697f2026d982066cbeed1c665dc04a8cad63293f1373be464065117e0cdcdde022e63b6172460880d56c31f246026ab67b8bfa13306c4bfa
@@ -60,7 +60,7 @@ module CarrierWave
60
60
 
61
61
  def upload_media(url, tmpfile)
62
62
  newline = "\r\n"
63
- filename = tmpfile.original_filename
63
+ filename = File.basename(tmpfile.path)
64
64
  boundary = "ClientTouchReceive----------#{Time.now.usec}"
65
65
 
66
66
  uri = URI.parse(url)
@@ -70,7 +70,7 @@ module CarrierWave
70
70
  post_body << "Content-Disposition: form-data; name=\"File1\"; filename=\"#{filename}\"#{newline}"
71
71
  post_body << "Content-Type: application/octet-stream#{newline}"
72
72
  post_body << "#{newline}"
73
- post_body << File.read(tmpfile.tempfile)
73
+ post_body << File.read(tmpfile.path)
74
74
  post_body << "#{newline}--#{boundary}--#{newline}"
75
75
 
76
76
  request = Net::HTTP::Post.new(uri.request_uri)
@@ -1,5 +1,5 @@
1
1
  module Carrierwave
2
2
  module Sharefile
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -116,7 +116,7 @@ module CarrierWave
116
116
  # [Boolean] true on success or raises error
117
117
  #
118
118
  def store(file)
119
- sharefile_file = file
119
+ sharefile_file = file.to_file
120
120
  @content_type ||= file.content_type
121
121
  root_folder = @config[:sharefile_root]
122
122
  @file = @client.store_document(root_folder, @path, sharefile_file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-sharefile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew McFarling