Sha256: 70151250c134e8847ddc1b02e9f3f1dc7e813b61eda34a55c3276e6c2abde71c

Contents?: true

Size: 1015 Bytes

Versions: 25

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: true

require_relative "base"

module Neetob
  class CLI
    module Heroku
      module ConfigVars
        class Remove < Base
          attr_accessor :apps, :keys, :sandbox

          def initialize(apps, keys = [], sandbox = false)
            super()
            @apps = apps
            @keys = keys
            @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

              keys.each do |key|
                `heroku config:unset #{key} -a #{app}`
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
neetob-ud-1.0.59 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.8 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.6 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.4 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.3 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.2 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.1 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.0 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.1.3 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.1.2 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.1.1 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.1.0 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.2.2 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.2.1 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.2.0 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.1.5 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.14 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.13 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.1.4 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-ud-0.2.11 lib/neetob/cli/heroku/config_vars/remove.rb