lib/bora/tasks.rb in bora-0.6.0 vs lib/bora/tasks.rb in bora-0.7.0

- old
+ new

@@ -2,27 +2,34 @@ require 'rake/tasklib' require 'bora/stack' module Bora class Tasks < Rake::TaskLib - def initialize(stack_name) + def initialize(stack_name, template_uri = nil) @stack_name = stack_name @stack = Stack.new(stack_name) @colorize = true - if block_given? - within_namespace do - yield self + @stack_options = {} + within_namespace { yield self } if block_given? + + if template_uri + if @stack_options[:template_body] || @stack_options[:template_url] + raise "You cannot specify a template in the constructor as well as in the stack_options" + else + @stack_options[:template_url] = template_uri end end + define_tasks end attr_writer :stack_options def colorize=(value) @colorize = value String.disable_colorization = !@colorize end + private def define_tasks define_apply_task