Class: Neetob::CLI::Heroku::AutoscalingConfig

Inherits:
Base
  • Object
show all
Defined in:
lib/neetob/cli/heroku/autoscaling_config.rb

Constant Summary

Constants inherited from Base

Base::NEETO_DEPLOY_DOCS

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods inherited from Base

#process

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initialize(app) ⇒ AutoscalingConfig

Returns a new instance of AutoscalingConfig.



14
15
16
17
# File 'lib/neetob/cli/heroku/autoscaling_config.rb', line 14

def initialize(app)
  super()
  @app = app
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



12
13
14
# File 'lib/neetob/cli/heroku/autoscaling_config.rb', line 12

def app
  @app
end

Instance Method Details

#runObject

Raises:

  • (StandardError)


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/neetob/cli/heroku/autoscaling_config.rb', line 19

def run
  raise(StandardError, "HEROKU_API_KEY is not given") if ENV["HEROKU_API_KEY"].nil?

  url = create_url(app)
  response = get(url)
  if response.any? { |addon| addon[:addon_service][:name] == "judoscale" }
    ui.success("Judoscale addon is #{print_success('enabled')} for #{app}")
  else
    ui.error("Judoscale #{print_failure('not present')} for #{app}")
  end
end