Sha256: 4afd309bc01efd1a26180c7611f1497bd0ed82b44cbe0ab9ed5b1dd2b457db2b

Contents?: true

Size: 1.08 KB

Versions: 25

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

require_relative "../../base"

module Neetob
  class CLI
    module Heroku
      module Access
        class Remove < Base
          attr_accessor :apps, :users_to_be_removed, :sandbox

          def initialize(apps, users_to_be_removed = [], sandbox = false)
            super()
            @apps = apps
            @users_to_be_removed = users_to_be_removed
            @sandbox = sandbox
          end

          def run
            matching_apps = find_all_matching_apps(apps, :heroku, sandbox)
            matching_apps.each do |app|
              `heroku access -a #{app}`
              unless $?.success?
                ui.error("There is a problem in accessing the app with name \"#{app}\" in your account.")
                ui.error("Please check the specified app name and ensure you're authorized to view that app.")
                next
              end

              users_to_be_removed.each do |user|
                ui.info(`heroku access:remove #{user} -a #{app}`)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
neetob-ud-0.2.9 lib/neetob/cli/heroku/access/remove.rb
neetob-ud-0.2.5 lib/neetob/cli/heroku/access/remove.rb
neetob-0.1.2 lib/neetob/cli/heroku/access/remove.rb
neetob-0.1.1 lib/neetob/cli/heroku/access/remove.rb
neetob-0.1.0 lib/neetob/cli/heroku/access/remove.rb