Sha256: 95eeeb183a423e00f5767dd0139f82391901627613ffba9d5715632eb9c1aae0

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

#!/usr/bin/env ruby

require 'optparse'
require 't2-web'

# Set up and parse arguments
opts = OptionParser.new do |opt|
  opt.banner = "Usage: t2-web [options] start|stop|restart"
  opt.separator("\nSupports the following options:")
  opt.on("-d", "--daemonize", "Run daemonized in the background")
  opt.on("-p", "--port PORT", "Use PORT (default: 3000)")
  opt.on("-s", "--servers NUM", "Number of servers to start")
  opt.on_tail("-v", "--version", "Show the version") do
    puts "Taverna 2 Web Interface Generator version: #{T2Web::VERSION}"
    exit
  end
  opt.on_tail("-h", "-?", "--help", "Show this message") do
    puts opt
    exit
  end
end

# parse options (currently only displaying and passing all to thin!)
opts.parse!

if ARGV.size == 0
  puts opts
  exit
end

# TODO: call webapp via rack and ruby rather than from the prompt!!

INSTALL_DIR = `gem environment gemdir`.chomp + "/gems/t2-web-#{T2Web::VERSION}/bin"

# cd to proper dir and run thin $* for now
success = `cd #{INSTALL_DIR} ; thin #{$*.join(' ')}`

if success
  puts "Running: thin #{$*.join(' ')} !"
else
  puts "Failed running: thin #{$*} !"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
t2-web-0.2.0 bin/t2-web
t2-web-0.1.9 bin/t2-web
t2-web-0.1.8 bin/t2-web