class ElasticDot::Command::Addons

Public Class Methods

add(addon, opts) click to toggle source
# File lib/elasticdot/command/addons.rb, line 2
def self.add(addon, opts)
  find_app! opts

  addon, tier = addon[0].split ':', 2

  puts "Configuring addon #{addon} for app #{@app}..."

  api.post "/apps/#{@app}/addons/#{addon}", tier: tier
end
list() click to toggle source
# File lib/elasticdot/command/addons.rb, line 23
def self.list
  addons = api.get '/addons'

  puts '=== available'
  addons.each { |a, i| puts a['name'] }
end
remove(addons, opts) click to toggle source
# File lib/elasticdot/command/addons.rb, line 12
def self.remove(addons, opts)
  find_app! opts

  addons.each do |addon|
    addon = addon.split(':')[0]

    puts "Removing addon #{addon} from app #{@app}..."
    api.delete "/apps/#{@app}/addons/#{addon}"
  end
end