Sha256: 529b9c421bf00cb72f351c1395a2b975ca769a6db493578db410395b0446e914

Contents?: true

Size: 1.03 KB

Versions: 71

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby

require 'rbbt-util'
require 'rbbt/resource'
require 'rbbt/workflow'

options = SOPT.get <<EOF
-w--workflows* Workflows to use; 'all' for all in Rbbt.etc.workflows:
-r--requires* Files to require; 'all' for all in Rbbt.etc.requires:
-f--force Force the production if the file is already present
-h--help Help
EOF

if options[:help]
  puts SOPT.doc 
  exit
end

case options[:workflows]
when nil, false, "false", "none"
when "all"
  Rbbt.etc.workflows.list.each do |workflow|
    Workflow.require_workflow file
  end if Rbbt.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"
  Rbbt.etc.requires.list.each do |file|
    require file
  end if Rbbt.etc.requires.exists?
else
  options[:requires].split(/[ ,;|]/).each do |file|
    require file
  end
end

resource, path = ARGV

force = options[:force]

resource = Kernel.const_get(resource)

puts resource[path].produce(force).find

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
rbbt-util-5.19.10 share/rbbt_commands/resource/produce
rbbt-util-5.19.9 share/rbbt_commands/resource/produce
rbbt-util-5.19.8 share/rbbt_commands/resource/produce
rbbt-util-5.19.7 share/rbbt_commands/resource/produce
rbbt-util-5.19.6 share/rbbt_commands/resource/produce
rbbt-util-5.19.5 share/rbbt_commands/resource/produce
rbbt-util-5.19.4 share/rbbt_commands/resource/produce
rbbt-util-5.19.3 share/rbbt_commands/resource/produce
rbbt-util-5.19.2 share/rbbt_commands/resource/produce
rbbt-util-5.19.1 share/rbbt_commands/resource/produce
rbbt-util-5.19.0 share/rbbt_commands/resource/produce