Module: RakeRoll::GitCommands

Included in:
Roller
Defined in:
lib/rake_roll/git_commands.rb

Instance Method Summary collapse

Instance Method Details

#get_current_branchObject



5
6
7
8
# File 'lib/rake_roll/git_commands.rb', line 5

def get_current_branch
  #run as a direct command to retrieve the output
  `git rev-parse --abbrev-ref HEAD`.chomp
end

#git_add(file) ⇒ Object



25
26
27
28
# File 'lib/rake_roll/git_commands.rb', line 25

def git_add(file)
  puts "Adding #{file}"
  system("git add #{file}")
end

#git_commit(message) ⇒ Object



35
36
37
38
# File 'lib/rake_roll/git_commands.rb', line 35

def git_commit(message)
  puts "Commiting: #{message}"
  system("git commit CHANGELOG VERSION -m '#{message}'")
end

#git_log(log_type) ⇒ Object



20
21
22
23
# File 'lib/rake_roll/git_commands.rb', line 20

def git_log(log_type)
  #run as a direct command to retrieve the output
  `git log #{log_type}`
end

#git_push_branch(branch) ⇒ Object



10
11
12
13
# File 'lib/rake_roll/git_commands.rb', line 10

def git_push_branch(branch)
  puts "Pushing to origin #{branch}"
  system("git push origin #{branch}")
end

#git_push_tagsObject



15
16
17
18
# File 'lib/rake_roll/git_commands.rb', line 15

def git_push_tags
  puts "Pushing tags"
  system("git push --tags")
end

#git_tag(tag) ⇒ Object



30
31
32
33
# File 'lib/rake_roll/git_commands.rb', line 30

def git_tag(tag)
  puts "Creating tag #{new_version}"
  system("git tag #{tag}")
end