Sha256: 895966b75121b0629cfc11c171175827a83b7053b26c52641547c336da574e97

Contents?: true

Size: 749 Bytes

Versions: 5

Compression:

Stored size: 749 Bytes

Contents

module HerokuPgBackupsArchive
  module ToolbeltHelper
    class << self
      def capture_backup
        run("pg:backups capture -a #{HerokuPgBackupsArchive.config.app_name}")
      end

      def fetch_backup_public_url(backup_id)
        run("pg:backups public-url #{backup_id} -q -a #{HerokuPgBackupsArchive.config.app_name}")
      end

      def fetch_backup_info(backup_id)
        run("pg:backups info #{backup_id} -a #{HerokuPgBackupsArchive.config.app_name}")
      end

      private

      def run(arguments)
        command = "#{HerokuPgBackupsArchive.config.heroku_toolbelt_path} #{arguments}"
        puts "Running: #{command}"
        output = `#{command}`
        puts "Output:\n#{output}"
        output
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
heroku_pg_backups_archive-0.2.0 lib/heroku_pg_backups_archive/toolbelt_helper.rb
heroku_pg_backups_archive-0.1.3 lib/heroku_pg_backups_archive/toolbelt_helper.rb
heroku_pg_backups_archive-0.1.2 lib/heroku_pg_backups_archive/toolbelt_helper.rb
heroku_pg_backups_archive-0.1.1 lib/heroku_pg_backups_archive/toolbelt_helper.rb
heroku_pg_backups_archive-0.1.0 lib/heroku_pg_backups_archive/toolbelt_helper.rb