lib/eco/api/usecases/default_cases/samples/sftp_case.rb in eco-helpers-2.0.52 vs lib/eco/api/usecases/default_cases/samples/sftp_case.rb in eco-helpers-2.0.53
- old
+ new
@@ -1,13 +1,13 @@
class Eco::API::UseCases::DefaultCases::Samples::Sftp < Eco::API::Common::Loaders::UseCase
name "sftp-sample"
type :other
- attr_reader :session
+ attr_reader :session, :options
def main(session, options, usecase)
- @session = session
+ @session = session; @options = options
options[:end_get] = false
raise "The SFTP is not configured" unless session.sftp?
case options.dig(:sftp, :command)
when :list
list_folder
@@ -90,10 +90,10 @@
def to_remote_path(file)
remote_folder + "/" + file
end
def local_folder
- "."
+ options.dig(:sftp, :local_folder) || "."
end
def remote_folder
@remote_folder ||= sftp_config.remote_folder + remote_subfolder
end