Class: Neetob::CLI::Heroku::Access::Remove
- Defined in:
- lib/neetob/cli/heroku/access/remove.rb
Constant Summary
Constants inherited from Base
Constants inherited from Base
Instance Attribute Summary collapse
-
#apps ⇒ Object
Returns the value of attribute apps.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#users_to_be_removed ⇒ Object
Returns the value of attribute users_to_be_removed.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(apps, users_to_be_removed = [], sandbox = false) ⇒ Remove
constructor
A new instance of Remove.
- #run ⇒ Object
Methods inherited from Base
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(apps, users_to_be_removed = [], sandbox = false) ⇒ Remove
Returns a new instance of Remove.
12 13 14 15 16 17 |
# File 'lib/neetob/cli/heroku/access/remove.rb', line 12 def initialize(apps, users_to_be_removed = [], sandbox = false) super() @apps = apps @users_to_be_removed = users_to_be_removed @sandbox = sandbox end |
Instance Attribute Details
#apps ⇒ Object
Returns the value of attribute apps.
10 11 12 |
# File 'lib/neetob/cli/heroku/access/remove.rb', line 10 def apps @apps end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
10 11 12 |
# File 'lib/neetob/cli/heroku/access/remove.rb', line 10 def sandbox @sandbox end |
#users_to_be_removed ⇒ Object
Returns the value of attribute users_to_be_removed.
10 11 12 |
# File 'lib/neetob/cli/heroku/access/remove.rb', line 10 def users_to_be_removed @users_to_be_removed end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/neetob/cli/heroku/access/remove.rb', line 19 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 |