From b13ec819dc6e6e60febbe5ef511456c4dfdb1f31 Mon Sep 17 00:00:00 2001 From: anonymous Date: Sat, 24 Sep 2022 12:06:16 +0200 Subject: [PATCH] use cwd --- lib/routes.rb | 2 +- lib/server.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes.rb b/lib/routes.rb index d01a1d5..bc92670 100644 --- a/lib/routes.rb +++ b/lib/routes.rb @@ -4,7 +4,7 @@ require 'haml' class Routes < Sinatra::Base set :views, Proc.new{ - File.join root, '/../', 'pokes', 'views' + File.join Dir.pwd, 'pokes', 'views' } get 'custom/routes' do diff --git a/lib/server.rb b/lib/server.rb index 754e319..3a0d7e0 100644 --- a/lib/server.rb +++ b/lib/server.rb @@ -49,12 +49,12 @@ class Server < Routes post '/upload' do puts params FileUtils.copy(params[:data][:tempfile], - "#{__dir__}/upload.tmp") + "#{Dir.pwd}/upload.tmp") return 'OK' end get '/uploads' do - Fx::pipe(__dir__.concat('/upload.*'), + Fx::pipe(Dir.pwd.concat('/upload.*'), -> (t) { Dir.glob(t) }, -> (t) { t.each { |f| File.delete f }