lib/blueprint/blueprint.rb in webbynode-blueprint-0.0.2 vs lib/blueprint/blueprint.rb in webbynode-blueprint-0.0.3
- old
+ new
@@ -1,5 +1,6 @@
+require 'pp'
require "blueprint/components"
require "blueprint/utils"
require "yaml"
class Blueprint
@@ -20,28 +21,29 @@
if opts
@def.merge!(opts)
else
- @def[:name] ||= s
+ @def[:content] ||= s
@def[:script] = "#{s}.sh"
- @def[:email] = "#{s}.markdown"
+ @def[:email] = "#{s}.markdown" if @def["item_type"] == "readystack"
+ @def[:item_type] ||= "stack"
end
(errors ||= []) << "provides requires the blueprint name" if @def.empty?
- (errors ||= []) << "no blueprint name found for #{@def[:content]}" unless @def.has_key?(:name)
- (errors ||= []) << "no email template found for #{@def[:content]}" unless @def.has_key?(:email)
+ (errors ||= []) << "no blueprint name found" unless @def.has_key?(:content)
+ # (errors ||= []) << "no email template found for #{@def[:content]}" unless @def.has_key?(:email)
(errors ||= []) << "no script found for #{@def[:content]}" unless @def.has_key?(:script)
raise "Errors: #{errors * ", "}" if errors
end
def requires(req)
if req.is_a?(Hash)
requirement_def = { :group => req[:group], :contains => req[:with] }
else
- requirement_def = { :group => req, :contains => req }
+ requirement_def = { :group => req, :contains => [req] }
end
(@def[:dependencies] ||= []) << requirement_def
end
\ No newline at end of file