Sha256: c1556a0eac7c0c1eabb2a8c571d5ead009d6ab23c7c60506cddece3e32c8f81f

Contents?: true

Size: 1.15 KB

Versions: 288

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.exists? resource[path].find
end

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

Version data entries

288 entries across 288 versions & 1 rubygems

Version Path
rbbt-util-5.19.26 share/rbbt_commands/resource/exists
rbbt-util-5.19.25 share/rbbt_commands/resource/exists
rbbt-util-5.19.24 share/rbbt_commands/resource/exists
rbbt-util-5.19.23 share/rbbt_commands/resource/exists
rbbt-util-5.19.22 share/rbbt_commands/resource/exists
rbbt-util-5.19.21 share/rbbt_commands/resource/exists
rbbt-util-5.19.20 share/rbbt_commands/resource/exists
rbbt-util-5.19.19 share/rbbt_commands/resource/exists
rbbt-util-5.19.18 share/rbbt_commands/resource/exists
rbbt-util-5.19.17 share/rbbt_commands/resource/exists
rbbt-util-5.19.16 share/rbbt_commands/resource/exists
rbbt-util-5.19.15 share/rbbt_commands/resource/exists
rbbt-util-5.19.14 share/rbbt_commands/resource/exists
rbbt-util-5.19.13 share/rbbt_commands/resource/exists
rbbt-util-5.19.12 share/rbbt_commands/resource/exists
rbbt-util-5.19.11 share/rbbt_commands/resource/exists
rbbt-util-5.19.10 share/rbbt_commands/resource/exists
rbbt-util-5.19.9 share/rbbt_commands/resource/exists
rbbt-util-5.19.8 share/rbbt_commands/resource/exists
rbbt-util-5.19.7 share/rbbt_commands/resource/exists