Sha256: 9e4dd1d96169ac8263be270fcfb7c3b0a8e0cd837c482a1691fa58b5680a3544

Contents?: true

Size: 941 Bytes

Versions: 536

Compression:

Stored size: 941 Bytes

Contents

#!/usr/bin/env ruby

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

options = SOPT.setup <<EOF

Init a new workflow scaffold

$ rbbt workflow init <workflow>
EOF

workflow = ARGV.shift
if workflow.nil?
  usage
  puts
  puts Log.color :magenta, "## Error"
  puts
  puts "No workflow name specified."
  puts
  exit -1
end

workflow_path = Path.setup(workflow) unless Path === workflow
lib_path = workflow_path + '/lib'

if Dir.exists?(workflow_path)
  usage
  puts
  puts Log.color :magenta, "## Error"
  puts
  puts "The workflow '#{workflow}' already exists!"
  puts
  exit -1
end

template = <<-EOF
require 'rbbt/workflow'

module #{workflow}
  extend Workflow

  desc "Scaffold task"
  task :scaffold_task => :string do
    "Scaffold task"
  end

end
EOF

Dir.mkdir(workflow_path)
workflow_file = workflow_path + '/workflow.rb'
File.write(workflow_file, template)

Dir.mkdir(lib_path)
lib_file = lib_path + '/.keep'
File.write(lib_file, '')

Version data entries

536 entries across 536 versions & 1 rubygems

Version Path
rbbt-util-5.43.0 share/rbbt_commands/workflow/init
rbbt-util-5.42.0 share/rbbt_commands/workflow/init
rbbt-util-5.41.1 share/rbbt_commands/workflow/init
rbbt-util-5.41.0 share/rbbt_commands/workflow/init
rbbt-util-5.40.5 share/rbbt_commands/workflow/init
rbbt-util-5.40.4 share/rbbt_commands/workflow/init
rbbt-util-5.40.3 share/rbbt_commands/workflow/init
rbbt-util-5.40.0 share/rbbt_commands/workflow/init
rbbt-util-5.39.0 share/rbbt_commands/workflow/init
rbbt-util-5.38.1 share/rbbt_commands/workflow/init
rbbt-util-5.38.0 share/rbbt_commands/workflow/init
rbbt-util-5.37.16 share/rbbt_commands/workflow/init
rbbt-util-5.37.15 share/rbbt_commands/workflow/init
rbbt-util-5.37.14 share/rbbt_commands/workflow/init
rbbt-util-5.37.13 share/rbbt_commands/workflow/init
rbbt-util-5.37.12 share/rbbt_commands/workflow/init
rbbt-util-5.37.11 share/rbbt_commands/workflow/init
rbbt-util-5.37.10 share/rbbt_commands/workflow/init
rbbt-util-5.37.9 share/rbbt_commands/workflow/init
rbbt-util-5.37.8 share/rbbt_commands/workflow/init