Sha256: 29078cd0adaa2a82b502060406dbb1cf3d95fbea8ae2ae5f4a5d8b52c843c43e

Contents?: true

Size: 1.09 KB

Versions: 73

Compression:

Stored size: 1.09 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_or_repos(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

73 entries across 73 versions & 1 rubygems

Version Path
neetob-0.5.10 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.9 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.8 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.7 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.6 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.5 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.4 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.3 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.2 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.1 lib/neetob/cli/heroku/access/remove.rb
neetob-0.5.0 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.37 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.36 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.35 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.34 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.33 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.32 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.31 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.30 lib/neetob/cli/heroku/access/remove.rb
neetob-0.4.28 lib/neetob/cli/heroku/access/remove.rb