Sha256: 780ab50dd738e0884c65d12981208b84e2563ddc594e42cd09c6b593ab004799
Contents?: true
Size: 1.37 KB
Versions: 9
Compression:
Stored size: 1.37 KB
Contents
#!/usr/bin/env ruby require 'scout' $0 = "scout #{$previous_commands.any? ? $previous_commands*" " + " " : "" }#{ File.basename(__FILE__) }" if $previous_commands options = SOPT.setup <<EOF Produce a resource $ #{$0} [<options>] <Resource> <file> -h--help Print this help -W--workflows* Workflows to use; 'all' for all in Scout.etc.workflows: -r--requires* Files to require; 'all' for all in Scout.etc.requires: -f--force Force the production if the file is already present EOF if options[:help] if defined? scout_usage scout_usage else puts SOPT.doc end exit 0 end case options[:workflows] when nil, false, "false", "none" when "all" Scout.etc.workflows.list.each do |workflow| Workflow.require_workflow file end if Scout.etc.workflows.exists? else options[:workflows].split(/[ ,;|]/).each do |workflow| Workflow.require_workflow workflow end end case options[:requires] when nil, false, "false", "none" when "all" Scout.etc.requires.list.each do |file| require file end if Scout.etc.requires.exists? else options[:requires].split(/[ ,;|]/).each do |file| require file end end resource, path = ARGV begin resource = Kernel.const_get(resource) rescue begin resource = Workflow.require_workflow resource rescue raise "Resource not found: #{ resource }" end end force = options[:force] puts resource[path].produce(force).find
Version data entries
9 entries across 9 versions & 1 rubygems