yahns.git  about / heads / tags
sleepy, multi-threaded, non-blocking application server for Ruby
blob efa267a4e4e44008bd288bea42b7af0d320ee233 1018 bytes (raw)
$ git show v0.0.3:bin/yahns	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
#!/this/will/be/overwritten/or/wrapped/anyways/do/not/worry/ruby
# -*- encoding: binary -*-
# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
require 'yahns/daemon'
require 'optparse'
config_file = daemonize = nil
OptionParser.new("", 24, "  ") do |opts|
  cmd = File.basename($0)
  opts.banner = "Usage: #{cmd} [options]"
  opts.separator "#{cmd} options:"
  opts.on("-D", "--daemonize", "run daemonized in the background") do |d|
    daemonize = !!d
  end
  opts.on("-c", "--config-file FILE", "yahns config file") do |f|
    config_file = f
  end
  opts.separator "Common options:"
  opts.on_tail("-h", "--help", "Show this message") do
    puts opts.to_s
    exit
  end
  opts.on_tail("-v", "--version", "Show version") do
    puts "#{cmd} v#{Yahns::VERSION}"
    exit
  end
  opts.parse!(ARGV)
end
server = Yahns::Server.new(Yahns::Config.new(config_file))
Yahns::Daemon.daemon(server) if daemonize
server.start.join

git clone git://yhbt.net/yahns.git
git clone https://yhbt.net/yahns.git