From a306e4a3dee7506893b31032f3c8c0426a7a1c42 Mon Sep 17 00:00:00 2001 From: Alex Young Date: Wed, 25 Mar 2015 15:01:28 +0000 Subject: Provide a default output stream in 1.9 --- bin/mauveconsole | 0 bin/mauvesend | 0 bin/mauveserver | 14 ++++++++------ 3 files changed, 8 insertions(+), 6 deletions(-) mode change 100644 => 100755 bin/mauveconsole mode change 100644 => 100755 bin/mauvesend mode change 100644 => 100755 bin/mauveserver (limited to 'bin') diff --git a/bin/mauveconsole b/bin/mauveconsole old mode 100644 new mode 100755 diff --git a/bin/mauvesend b/bin/mauvesend old mode 100644 new mode 100755 diff --git a/bin/mauveserver b/bin/mauveserver old mode 100644 new mode 100755 index b0c3573..286b126 --- a/bin/mauveserver +++ b/bin/mauveserver @@ -1,4 +1,4 @@ -#! /usr/bin/ruby1.8 +#! /usr/bin/env ruby # NAME # mauveserver -- receive alerts from station(s) around the network # @@ -26,7 +26,7 @@ # The configuration file consists of various stanzas, and sub-stanzas which # give give options for each part of the server. The example configuration # file gives a definitive explanation of all the options. -# +# # SEE ALSO # mauveclient(1), mauveconsole(1) # @@ -94,6 +94,8 @@ outputter.formatter = Log4r::PatternFormatter.new( :pattern => "%d [ %6.6l ] [ % outputter.level = verbose ? Log4r::DEBUG : Log4r::INFO logger.outputters << outputter +$defout ||= $stdout # This isn't set in 1.9. + def error(msg) logger = Log4r::Logger['Mauve'] logger.error "*** Error: #{msg}" @@ -134,12 +136,12 @@ begin builder.include_file(configuration_file) Mauve::Configuration.current = builder.result rescue StandardError => ex - error ex + error ex end if test logger.info "*** Configuration looks OK!" - exit 0 + exit 0 end %w(HUP).each do |sig| @@ -147,7 +149,7 @@ end Mauve::Server.instance.logger.warn "#{sig} signal received. Restarting." Mauve::Server.instance.stop - # + # # Reload configuration # begin @@ -210,6 +212,6 @@ begin logger.info "This is mauve #{Mauve::VERSION}" Mauve::Server.instance.start rescue StandardError => ex - error ex + error ex end -- cgit v1.2.1