Sha256: 77398a977dd0ecae2b5b865a5dd8470f41cc8a631c4d912cd7795721b023fc6d

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

#!/usr/bin/env ruby

# == Synopsis
#
# refinery: run the Refinery server
#
# == Usage
#
# refinery [OPTION]
#
# -h, --help:
#    show help
#
# -d, --debug:
#    turn on debug logging
#
# -c, --config filename
#    specify a configuration file
#
# -w, --workers directory
#    specify the directory for finding workers
#
# -v, --verbose
#    print info to the standard output

require 'getoptlong'
require 'rdoc/usage'
require 'refinery'

pidfile = 'refinery.pid'

options = {}
opts = GetoptLong.new(
  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
  [ '--debug', '-d', GetoptLong::NO_ARGUMENT ],
  [ '--config', '-c', GetoptLong::REQUIRED_ARGUMENT],
  [ '--workers', '-w', GetoptLong::REQUIRED_ARGUMENT],
  [ '--verbose', '-v', GetoptLong::NO_ARGUMENT],
  [ '--pidfile', GetoptLong::REQUIRED_ARGUMENT]
)
opts.each do |opt, arg|
  case opt
  when '--help'
    RDoc::usage
  when '--debug'
    options[:debug] = true
  when '--config'
    options[:config] = arg
  when '--workers'
    options[:workers] = arg
  when '--verbose'
    options[:verbose] = true
  when '--pidfile'
    pidfile = arg
  end
end

open(pidfile, 'w') do |f|
  f << $$
end

Refinery::Server.new(options).run

File.delete(pidfile)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
refinery-0.12.2 bin/refinery
refinery-0.12.1 bin/refinery
refinery-0.12.0 bin/refinery