Sha256: c568fb4dfde2ddf364509032a497f402bcdad98aeaccd2d19c58cad267e97ff8
Contents?: true
Size: 1.22 KB
Versions: 3
Compression:
Stored size: 1.22 KB
Contents
#!/usr/bin/env ruby require 'puma/cli' require 'optparse' require 'opener/core/resource_switcher' rack_config = File.expand_path('../../config.ru', __FILE__) switcher = Opener::Core::ResourceSwitcher.new puma_args = [rack_config] switcher_opts = {} option_parser = OptionParser.new do |opts| opts.banner = "Usage: #{File.basename($0)} [OPTIONS]" opts.separator "\nOptions:\n\n" opts.on('-h', '--help', 'Shows this help message') do abort option_parser.to_s end opts.on('-S', '--state PATH', 'Where to store the state details') do |val| puma_args += ['--state', val] end opts.on('-b', '--bind URI', 'URI to bind to (tcp://, unix://, ssl://)') do |val| puma_args += ['--bind', val] end opts.on('--pidfile PATH', 'Use PATH as a pidfile') do |val| puma_args += ['--pidfile', val] end opts.on('--daemon', 'Daemonize the server into the background') do |val| puma_args << '--daemon' end opts.on('-e', '--environment ENVIRONMENT', 'The environment to use') do |val| puma_args += ['--environment', val] end opts.separator "\nResource Options:\n\n" switcher.bind(opts, switcher_opts) end option_parser.parse!(ARGV) switcher.install(switcher_opts) Puma::CLI.new(puma_args).run
Version data entries
3 entries across 3 versions & 3 rubygems
Version | Path |
---|---|
opener-polarity-tagger-2.2.3 | bin/polarity-tagger-server |
opener-property-tagger-2.2.2 | bin/property-tagger-server |
opener-opinion-detector-1.1.2 | bin/opinion-detector-server |