Class: Ancor::CLI::Environment
- Defined in:
- lib/ancor/cli/environment.rb
Instance Method Summary collapse
- #add(slug) ⇒ Object
- #commit ⇒ Object
- #list ⇒ Object
- #plan(path_to_file) ⇒ Object
- #remove(slug) ⇒ Object
Instance Method Details
#add(slug) ⇒ Object
11 12 13 |
# File 'lib/ancor/cli/environment.rb', line 11 def add(slug) connection.add_env(slug) end |
#commit ⇒ Object
33 34 35 |
# File 'lib/ancor/cli/environment.rb', line 33 def commit connection.commit([:environment]) end |
#list ⇒ Object
5 6 7 8 |
# 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) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/ancor/cli/environment.rb', line 22 def plan(path_to_file) begin spec = File.read(path_to_file) connection.plan([:environment], spec) rescue IOError, Errno::ENOENT puts 'Could not read specification, make sure file path is correct' end end |
#remove(slug) ⇒ Object
16 17 18 |
# File 'lib/ancor/cli/environment.rb', line 16 def remove(slug) connection.remove_env(slug) end |