class Ancor::CLI::Environment

Public Instance Methods

add(slug) click to toggle source
# File lib/ancor/cli/environment.rb, line 11
def add(slug)
  connection.add_env(slug)
end
commit() click to toggle source
# File lib/ancor/cli/environment.rb, line 33
def commit
  connection.commit(options[:environment])
end
list() click to toggle source
# File lib/ancor/cli/environment.rb, line 5
def list
  parsed = JSON.parse(connection.list_envs.body)
  Formatador.display_table(parsed, ['id', 'slug', 'name','locked'])
end
plan(path_to_file) click to toggle source
# File lib/ancor/cli/environment.rb, line 22
def plan(path_to_file)
  begin
    spec = File.read(path_to_file)
    connection.plan(options[:environment], spec)
  rescue IOError, Errno::ENOENT
    puts 'Could not read specification, make sure file path is correct'
  end
end
remove(slug) click to toggle source
# File lib/ancor/cli/environment.rb, line 16
def remove(slug)
  connection.remove_env(slug)
end