class MGit::ShowCommand
Public Instance Methods
arity()
click to toggle source
# File lib/mgit/commands/show.rb, line 16 def arity [1, 1] end
description()
click to toggle source
# File lib/mgit/commands/show.rb, line 24 def description 'display commit object from any repository' end
execute(args)
click to toggle source
# File lib/mgit/commands/show.rb, line 3 def execute(args) @commit = args.shift case repos.size when 0 perror "Couldn't find commit #{@commit} in any repository." when 1 show_commit(repos.first) else show_menu end end
usage()
click to toggle source
# File lib/mgit/commands/show.rb, line 20 def usage 'show <commit-sha/obj>' end
Private Instance Methods
repos()
click to toggle source
# File lib/mgit/commands/show.rb, line 32 def repos @rs ||= Registry.select { |r| r.has_commit?(@commit) } end
show_commit(repo)
click to toggle source
# File lib/mgit/commands/show.rb, line 36 def show_commit(repo) System.git("show #{@commit}", chdir: repo.path, print_stdout: true) end