Module: GitDB::Commands

Defined in:
lib/git-db/commands.rb

Defined Under Namespace

Classes: ReceivePack, UploadPack

Class Method Summary (collapse)

Class Method Details

+ (Object) commands



3
4
5
# File 'lib/git-db/commands.rb', line 3

def self.commands
  @commands
end

+ (Object) execute(command, args = [])

Raises:

  • (ArgumentError)


7
8
9
10
11
# File 'lib/git-db/commands.rb', line 7

def self.execute(command, args=[])
  return unless commands
  raise ArgumentError, "Unknown command: #{command}" unless commands[command]
  commands[command].execute(args)
end

+ (Object) register(command, klass)



13
14
15
16
# File 'lib/git-db/commands.rb', line 13

def self.register(command, klass)
  @commands ||= {}
  @commands[command] = klass.new
end