Sha256: 1db637196151de1880f9232182a31824c33ad9228c0b11b82944cb9225831f47

Contents?: true

Size: 1.15 KB

Versions: 72

Compression:

Stored size: 1.15 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:
-c--create Try to create file if claimed:
-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

resource = Kernel.const_get(resource)

if options[:create]
  exists = resource[path].exists?
else
  exists = File.exist? resource[path].find
end

if exists
  puts ["Found", resource[path].find] * ": "
else
  puts ["Not found", resource[path]] * ": "
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
rbbt-util-5.21.62 share/rbbt_commands/resource/exists
rbbt-util-5.21.61 share/rbbt_commands/resource/exists
rbbt-util-5.21.60 share/rbbt_commands/resource/exists
rbbt-util-5.21.59 share/rbbt_commands/resource/exists
rbbt-util-5.21.58 share/rbbt_commands/resource/exists
rbbt-util-5.21.57 share/rbbt_commands/resource/exists
rbbt-util-5.21.56 share/rbbt_commands/resource/exists
rbbt-util-5.21.55 share/rbbt_commands/resource/exists
rbbt-util-5.21.54 share/rbbt_commands/resource/exists
rbbt-util-5.21.53 share/rbbt_commands/resource/exists
rbbt-util-5.21.51 share/rbbt_commands/resource/exists
rbbt-util-5.21.50 share/rbbt_commands/resource/exists
rbbt-util-5.21.49 share/rbbt_commands/resource/exists
rbbt-util-5.21.47 share/rbbt_commands/resource/exists
rbbt-util-5.21.46 share/rbbt_commands/resource/exists
rbbt-util-5.21.45 share/rbbt_commands/resource/exists
rbbt-util-5.21.44 share/rbbt_commands/resource/exists
rbbt-util-5.21.43 share/rbbt_commands/resource/exists
rbbt-util-5.21.42 share/rbbt_commands/resource/exists
rbbt-util-5.21.39 share/rbbt_commands/resource/exists