livinginthepast/fake_ftp

View on GitHub
lib/fake_ftp/server_commands/cwd.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module FakeFtp
  module ServerCommands
    class Cwd
      def run(ctx, wd, *)
        wd = "/#{wd}" unless wd.start_with?('/')
        ctx.workdir = wd
        '250 OK!'
      end
    end
  end
end