#!/usr/bin/env ruby # # Created by Luke Bayes on 2007-4-29. # Copyright (c) 2007. All rights reserved. begin require 'rubygems' rescue LoadError # no rubygems to load, so we fail silently end require 'optparse' require 'sprout' #require File.dirname(__FILE__) + '/../lib/sprout' include PatternPark OPTIONS = { :locations => [], :project_name => nil, :found_project_name => nil, :sprout_name => nil, :update => false, :update => false, :clean => false } MANDATORY_OPTIONS = %w( sprout_name ) parser = OptionParser.new do |opts| opts.banner = < 0) Sprout.insert_locations(OPTIONS[:locations]) end if(update) Sprout.update = true msg = <> Creating Sprout #{sprout_name} at #{path}" Sprout.project_name = project_name TemplateResolver.instance.replace_all = true sprout = Sprout.load(sprout_name) sprout.execute end if(sprout_name && !project_name) sprout = Sprout.load(sprout_name) sprout.execute end # Resolve the sprout within the current project if(found_project_name && update && sprout_name) Sprout.project_name = found_project_name sprout = Sprout.load(sprout_name) sprout.execute end Log.flush