Class: Lono::Seed

Inherits:
Object
  • Object
show all
Includes:
Blueprint::Root, Conventions
Defined in:
lib/lono/seed/base.rb,
lib/lono/seed.rb,
lib/lono/seed/service_role.rb

Overview

Subclasses should implement:

variables - Returns String with content of varibles files.
setup - Hook to do extra things like create IAM service roles.
finish - Finish hook after config files have been created.

Note there is no params method to hook. The Base class handles params well.

Defined Under Namespace

Modules: ServiceRole Classes: Base, Configs

Instance Method Summary collapse

Methods included from Conventions

#template_param_convention

Methods included from Blueprint::Root

#bundler_groups, #find_blueprint_root, #require_bundle_gems, #set_blueprint_root

Constructor Details

#initialize(blueprint, options = {}) ⇒ Seed

Returns a new instance of Seed.



6
7
8
9
10
# File 'lib/lono/seed.rb', line 6

def initialize(blueprint, options={})
  @blueprint, @options = blueprint, options
  set_blueprint_root(@blueprint)
  @template, @param = template_param_convention(options)
end

Instance Method Details

#createObject



12
13
14
15
16
17
18
# File 'lib/lono/seed.rb', line 12

def create
  puts "Creating starter config files for #{@blueprint}"
  configs_class = load_configs_class # ::Configs or Lono::Seed::Base
  configs = configs_class.new(@blueprint, @options)
  # The Configs class implements: variables
  configs.run # setup the instance variables
end