From 2eb3285f7654f28c90247fefeafe01c86ae708d1 Mon Sep 17 00:00:00 2001 From: bo-oz Date: Fri, 13 Apr 2018 09:05:13 +0300 Subject: [PATCH] Also accept regular File object --- lib/vimeo_me2/user/upload.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/vimeo_me2/user/upload.rb b/lib/vimeo_me2/user/upload.rb index c4688a7..b0251ee 100644 --- a/lib/vimeo_me2/user/upload.rb +++ b/lib/vimeo_me2/user/upload.rb @@ -32,10 +32,15 @@ def pull_upload name, link, options = {} def change_name name = nil video = VimeoMe2::Video.new(@token, @ticket['uri']) - video.name = name || @video.original_filename + video.name = name || get_file_name video.update end + def get_file_name + return @video.path if @video.is_a? File + return @video.original_filename + end + # 3.4 Update def create_video tus = {approach: 'tus', size: @video.size.to_s}