Class: GitGuts::Open

Inherits:
Thor::GitGroup show all
Defined in:
lib/git_guts/open.rb

Constant Summary collapse

WORKING_DIRECTORY =
Dir.getwd

Constants inherited from Thor::GitGroup

Thor::GitGroup::BASENAME

Instance Method Summary collapse

Methods inherited from Thor::GitGroup

basename, namespace

Instance Method Details

#openObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/git_guts/open.rb', line 8

def open
  begin
    repo = Git.open(WORKING_DIRECTORY)
    puts repo.object(sha).contents
  rescue ArgumentError
    puts "Could open repository. Is it a valid git repository ?"
  rescue Git::GitExecuteError
    puts "Not a valid git object"
  end
end