Sha256: 4c8953cca52143cf06431b96cc850c68d28d170b93c36056f8cb1534c5f85504

Contents?: true

Size: 687 Bytes

Versions: 8

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

require_relative '../interactive_listener'

class PgExport
  module Listeners
    class Interactive
      class RemoveOldDumpsFromFtp < InteractiveListener
        def on_step(step_name:, args:)
          @spinner = build_spinner("Checking for old dumps on #{args.first[:ftp_adapter]}")
        end

        def on_step_succeeded(step_name:, args:, value:)
          if value[:removed_dumps].any?
            @spinner.success([success, value[:removed_dumps].map { |filename| "    #{filename} removed" }].join("\n"))
          else
            @spinner.success([success, 'nothing to remove'].join(' '))
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pg_export-0.7.7 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb
pg_export-0.7.6 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb
pg_export-0.7.5 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb
pg_export-0.7.4 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb
pg_export-0.7.3 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb
pg_export-0.7.2 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb
pg_export-0.7.1 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb
pg_export-0.7.0 lib/pg_export/lib/pg_export/listeners/interactive/remove_old_dumps_from_ftp.rb