Class: Lono::Template::Dsl

Inherits:
Base
  • Object
show all
Defined in:
lib/lono/template/dsl.rb,
lib/lono/template/dsl/builder.rb

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Blueprint::Root

#bundler_groups, #find_blueprint_root, #require_bundle_gems, #set_blueprint_root

Constructor Details

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

Returns a new instance of Dsl.



4
5
6
# File 'lib/lono/template/dsl.rb', line 4

def initialize(blueprint, options={})
  super
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



3
4
5
# File 'lib/lono/template/dsl.rb', line 3

def results
  @results
end

Instance Method Details

#build_template(path) ⇒ Object



16
17
18
19
# File 'lib/lono/template/dsl.rb', line 16

def build_template(path)
  builder = Builder.new(path, @blueprint, @options)
  builder.build
end

#runObject



8
9
10
11
12
13
14
# File 'lib/lono/template/dsl.rb', line 8

def run
  puts "Generating CloudFormation templates for blueprint #{@blueprint.color(:green)}:" unless @options[:quiet]
  paths = Dir.glob("#{Lono.config.templates_path}/**/*.rb")
  paths.select{ |e| File.file?(e) }.each do |path|
    build_template(path)
  end
end