diff options
Diffstat (limited to 'git-mirror-backend.rb')
-rw-r--r-- | git-mirror-backend.rb | 9 |
1 files changed, 6 insertions, 3 deletions
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| |