blob: 25f7c3ea55bda0100dbbd0b38921986c5c0f0f07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# coding: utf-8
require 'shellwords'
class GitMirrorBackend
def repl(accountName)
@accountName = account_name
$stdin.each do |line|
args = line.shellsplit
out = self.send('cmd_'+args[0].gsub('-', '_'), *args[1..0])
if out.is_a? String
puts out
elsif out.is_a? Array
out.each do |outline|
puts outline
end
elsif out.is_a? Hash
out.each do |k,v|
puts "#{k}=#{v}"
end
else
raise "I don't know what to do with output value: #{out}"
end
end
self.finish
end
def finish
# noop
end
end
|