From 885b2f28f3b31539140a8466e6205903bc7cf1d2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 30 Oct 2013 23:52:38 +0000 Subject: yahns-rackup launcher This should make it easier for Rack users to get started with yahns. --- bin/yahns | 3 +-- bin/yahns-rackup | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 bin/yahns-rackup (limited to 'bin') diff --git a/bin/yahns b/bin/yahns index 5c4d34e..efa267a 100755 --- a/bin/yahns +++ b/bin/yahns @@ -2,8 +2,7 @@ # -*- encoding: binary -*- # Copyright (C) 2013, Eric Wong and all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) -$stdout.sync = $stderr.sync = true -require 'yahns' +require 'yahns/daemon' require 'optparse' config_file = daemonize = nil OptionParser.new("", 24, " ") do |opts| diff --git a/bin/yahns-rackup b/bin/yahns-rackup new file mode 100755 index 0000000..baf110b --- /dev/null +++ b/bin/yahns-rackup @@ -0,0 +1,9 @@ +#!/this/will/be/overwritten/or/wrapped/anyways/do/not/worry/ruby +# -*- encoding: binary -*- +# Copyright (C) 2013, Eric Wong and all contributors +# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) +require 'yahns/rackup_handler' +ARGV.grep(/\A(?:-s|--server)/)[0] and abort "--server has no effect for #$0" +ARGV[0, 0] = %w(-s yahns) +Rack::Handler.register('yahns', 'Yahns::RackupHandler') +Rack::Server.start -- cgit v1.2.3-24-ge0c7