Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Add filename and fileext form Entry#path to Entry#file filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Paramonov committed Aug 18, 2011
1 parent 468265f commit 504380f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dropbox/entry.rb
Expand Up @@ -150,7 +150,10 @@ def file(options={})
throw :not_a_file if directory?
return @cached_file if @cached_file && !options[:force]

file = Tempfile.new('downloaded', :encoding => "BINARY")
ext = ::File.extname(path)
name = ::File.basename(path, ext)

file = Tempfile.new([name, ext], :encoding => "BINARY")
file.write download
file.rewind

Expand Down

0 comments on commit 504380f

Please sign in to comment.