Class: GitWrapper::Commands::Show

Inherits:
Git
  • Object
show all
Defined in:
lib/git_wrapper/commands/show.rb

Instance Attribute Summary

Attributes inherited from Git

#error, #location_folder, #output

Instance Method Summary collapse

Methods inherited from Git

#execute, #initialize, #success?

Constructor Details

This class inherits a constructor from GitWrapper::Commands::Git

Instance Method Details

#baseObject



15
16
17
18
# File 'lib/git_wrapper/commands/show.rb', line 15

def base
  @version = ':1:'
  self
end

#commandObject



30
31
32
# File 'lib/git_wrapper/commands/show.rb', line 30

def command
  "show #{@version ? @version : 'HEAD:'}\"#{@file}\""
end

#commit(commit) ⇒ Object



10
11
12
13
# File 'lib/git_wrapper/commands/show.rb', line 10

def commit(commit)
  @version = "#{commit}:"
  self
end

#file(file_name) ⇒ Object



5
6
7
8
# File 'lib/git_wrapper/commands/show.rb', line 5

def file(file_name)
  @file = to_relative_path(file_name)
  self
end

#mineObject



20
21
22
23
# File 'lib/git_wrapper/commands/show.rb', line 20

def mine
  @version = ':2:'
  self
end

#resultObject



34
35
36
# File 'lib/git_wrapper/commands/show.rb', line 34

def result
  output
end

#theirsObject



25
26
27
28
# File 'lib/git_wrapper/commands/show.rb', line 25

def theirs
  @version = ':3:'
  self
end