From 71dc3b30449a4574455ff7eb9c390e30ad52ac4a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 Dec 2016 16:01:03 -0500 Subject: fix (wip) --- git-mirror-backend.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'git-mirror-backend.rb') diff --git a/git-mirror-backend.rb b/git-mirror-backend.rb index 25f7c3e..2be8830 100644 --- a/git-mirror-backend.rb +++ b/git-mirror-backend.rb @@ -4,11 +4,14 @@ require 'shellwords' class GitMirrorBackend def repl(accountName) - @accountName = account_name + @accountName = accountName $stdin.each do |line| args = line.shellsplit - out = self.send('cmd_'+args[0].gsub('-', '_'), *args[1..0]) - if out.is_a? String + args[0] = 'cmd_'+args[0].gsub('-', '_') + out = self.send(*args) + if out.nil? + # do nothing + elsif out.is_a? String puts out elsif out.is_a? Array out.each do |outline| -- cgit v1.2.3