Sha256: bee91444c989ce854eb58a0c953c691a033686744a1f1c2ad7a69c3a50b9b739

Contents?: true

Size: 1 KB

Versions: 59

Compression:

Stored size: 1 KB

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_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

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

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
neetob-0.5.16 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.15 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.14 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.13 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.12 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.11 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.10 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.9 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.8 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.7 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.6 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.5 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.4 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.3 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.2 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.1 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.5.0 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.4.37 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.4.36 lib/neetob/cli/heroku/config_vars/remove.rb
neetob-0.4.35 lib/neetob/cli/heroku/config_vars/remove.rb