Sha256: 7efbf029672cb73dde8d5f99921bfe305bc83cf200efda9420339f532858bc8c

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

module RestFtpDaemon

  # Handles transfers for Job class
  class Remote
    include LoggerHelper
    attr_reader :logger
    attr_reader :log_context

    def initialize url, log_context, options = {}
      # Logger
      @log_context = log_context || {}
      @logger = RestFtpDaemon::LoggerPool.instance.get :jobs

      # Extract URL parts
      @url = url
      @url.user ||= "anonymous"

      # Annnounce object
      log_info "Remote.initialize [#{url}]"
    end

    def connect
      # Debug mode ?
      debug_header if @debug
    end

    def close
      # Debug mode ?
      puts "-------------------- SESSION CLOSING --------------------------" if @debug
    end

  private

    # def log_context
    #   @log_context
    # end

    def myname
      self.class.to_s
    end

    def debug_header
      # Output header to STDOUT
      puts
      puts "-------------------- SESSION STARTING -------------------------"
      puts "class\t #{myname}"
      puts "host\t #{@url.host}"
      puts "user\t #{@url.user}"
      puts "port\t #{@url.port}"
      puts "options\t #{@options.inspect}"
      puts "---------------------------------------------------------------"
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rest-ftp-daemon-0.250.0 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.247.1 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.247.0 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.246.1 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.246.0 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.245.1 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.245 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.243.2 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.243.1 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.243 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.242.5 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.242.4 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.242.3 lib/rest-ftp-daemon/remote.rb
rest-ftp-daemon-0.242.2 lib/rest-ftp-daemon/remote.rb