Class: Automux::Controller::Blueprints

Inherits:
Base
  • Object
show all
Defined in:
lib/automux/controller/blueprints.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Base

#params

Instance Method Summary collapse

Methods inherited from Base

#check_blueprint, #initialize, #notify_error

Methods included from Support::Filters

#after_inherited, #before_filter, #inherited

Methods included from Support::Rendering

#render, #render_file

Constructor Details

This class inherits a constructor from Automux::Controller::Base

Instance Method Details

#copyObject Also known as: cp

$ automux blueprint copy source destination



24
25
26
27
28
29
# File 'lib/automux/controller/blueprints.rb', line 24

def copy
  clone_blueprint = Automux::Core::Blueprint.build_by_name(params[:clone_name])
  clone_blueprint.source = @blueprint
  @binding = clone_blueprint.get_binding
  render 'copy'
end

#createObject

This copies the content from default.yml and opens the new file using $EDITOR $ automux blueprint create new_blueprint_name



16
17
18
19
20
21
# File 'lib/automux/controller/blueprints.rb', line 16

def create
  blueprint = Automux::Core::Blueprint.build_by_name(params[:blueprint_name])
  blueprint.source = Automux::Cache::Blueprint.find_by_name('default')
  @binding = blueprint.get_binding
  render 'create'
end

#deleteObject Also known as: rm

$ automux blueprint delete some_blueprint



33
34
35
36
# File 'lib/automux/controller/blueprints.rb', line 33

def delete
  @binding = @blueprint.get_binding
  render 'delete'
end

#editObject

blueprint_name.yml will be searched under $HOME/.automux/blueprints $ automux blueprint edit blueprint_name



9
10
11
12
# File 'lib/automux/controller/blueprints.rb', line 9

def edit
  @binding = @blueprint.get_binding
  render 'edit'
end

#indexObject Also known as: list



39
40
41
# File 'lib/automux/controller/blueprints.rb', line 39

def index
  render 'index'
end