Class: GitWrapper::Commands::Tag
- Inherits:
-
Git
- Object
- Git
- GitWrapper::Commands::Tag
show all
- Defined in:
- lib/git_wrapper/commands/tag.rb
Instance Attribute Summary
Attributes inherited from Git
#error, #location_folder, #output
Instance Method Summary
collapse
Methods inherited from Git
#execute, #initialize, #to_relative_path
Instance Method Details
#command ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/git_wrapper/commands/tag.rb', line 27
def command
command = 'tag '
if @mode == :create
command += "#{@name} #{@commit.nil? ? '' : @commit}"
elsif @mode == :remove
command += "-d #{@name}"
elsif @mode == :list
else
raise 'Unespecified tag mode'
end
command
end
|
#create(name) ⇒ Object
5
6
7
8
9
|
# File 'lib/git_wrapper/commands/tag.rb', line 5
def create(name)
@mode = :create
@name = name
self
end
|
#from(commit) ⇒ Object
11
12
13
14
|
# File 'lib/git_wrapper/commands/tag.rb', line 11
def from(commit)
@commit = commit
self
end
|
#list ⇒ Object
22
23
24
25
|
# File 'lib/git_wrapper/commands/tag.rb', line 22
def list
@mode = :list
self
end
|
#remove(name) ⇒ Object
16
17
18
19
20
|
# File 'lib/git_wrapper/commands/tag.rb', line 16
def remove(name)
@mode = :remove
@name = name
self
end
|
#result ⇒ Object
43
44
45
46
|
# File 'lib/git_wrapper/commands/tag.rb', line 43
def result
return result_list if @mode == :list
super
end
|
#result_list ⇒ Object
48
49
50
|
# File 'lib/git_wrapper/commands/tag.rb', line 48
def result_list
output.split("\n")
end
|