From 3af36c719610dddf0803882b124e7486819a45ab Mon Sep 17 00:00:00 2001 From: Denver Gingerich Date: Fri, 13 Jan 2017 13:06:29 +0000 Subject: [PATCH] some minor updates to the recently-merged 26d6c4f * include new copyright line, as the file has an additional author now * split up the `require` lines a bit as we're not alphabetical anymore * move/rename the HTTP listen port in the command-line parameters * revert ARGV change since others missed in 26d6c4f; reordering anyway * add comment to #write so I remember why it was added to begin with --- sgx-catapult.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sgx-catapult.rb b/sgx-catapult.rb index b2a1be1b2cf18b0a96e6f50be66b44c891aca713..2fe34b8dd8c994e31abac3b90aa0f65248b29e0a 100755 --- a/sgx-catapult.rb +++ b/sgx-catapult.rb @@ -1,6 +1,7 @@ #!/usr/bin/env ruby # # Copyright (C) 2017 Denver Gingerich +# Copyright (C) 2017 Stephen Paul Weber # # This file is part of sgx-catapult. # @@ -22,6 +23,7 @@ require 'json' require 'net/http' require 'redis/connection/hiredis' require 'uri' + require 'goliath/api' require 'goliath/server' require 'log4r' @@ -29,8 +31,8 @@ require 'log4r' if ARGV.size != 8 then puts "Usage: sgx-catapult.rb " + " " + - " " + - " " + " " + + "" exit 0 end @@ -41,6 +43,7 @@ module SGXcatapult client.run end + # so classes outside this module can write messages, too def self.write(stanza) client.write(stanza) end @@ -78,7 +81,7 @@ module SGXcatapult cred_key = "catapult_cred-" + bare_jid conn = Hiredis::Connection.new - conn.connect(ARGV[5], ARGV[6].to_i) + conn.connect(ARGV[4], ARGV[5].to_i) conn.write ["EXISTS", cred_key] if conn.read == 0 @@ -385,7 +388,7 @@ end EM.run do SGXcatapult.run - server = Goliath::Server.new('127.0.0.1', ARGV[4].to_i) + server = Goliath::Server.new('127.0.0.1', ARGV[7].to_i) server.api = WebhookHandler.new server.app = Goliath::Rack::Builder.build(server.api.class, server.api) server.logger = Log4r::Logger.new('goliath')