Module: Versionator::Git
- Included in:
- Version
- Defined in:
- lib/versionator/git.rb
Instance Method Summary collapse
- #git_checkout(branch = 'master') ⇒ Object
- #git_command(str) ⇒ Object
- #git_commit(message = nil) ⇒ Object
- #git_current_branch ⇒ Object
- #git_pull(branch = 'master') ⇒ Object
- #git_push(branch = 'master') ⇒ Object
- #git_tag ⇒ Object
Instance Method Details
#git_checkout(branch = 'master') ⇒ Object
7 8 9 |
# File 'lib/versionator/git.rb', line 7 def git_checkout(branch = 'master') git_command("git checkout #{branch}") end |
#git_command(str) ⇒ Object
28 29 30 |
# File 'lib/versionator/git.rb', line 28 def git_command(str) systemu(str).drop(1).join(" ") end |
#git_commit(message = nil) ⇒ Object
19 20 21 22 |
# File 'lib/versionator/git.rb', line 19 def git_commit( = nil) = "tag new release v#{version_name}" if .blank? git_command("git commit -a -m '#{}'") end |
#git_current_branch ⇒ Object
3 4 5 |
# File 'lib/versionator/git.rb', line 3 def git_current_branch git_command("git branch").split(/\n/).grep(/\*/).first.gsub('* ', '') end |
#git_pull(branch = 'master') ⇒ Object
11 12 13 |
# File 'lib/versionator/git.rb', line 11 def git_pull(branch = 'master') git_command("git pull origin #{branch}") end |
#git_push(branch = 'master') ⇒ Object
24 25 26 |
# File 'lib/versionator/git.rb', line 24 def git_push(branch = 'master') git_command("git push origin #{branch} --tags") end |
#git_tag ⇒ Object
15 16 17 |
# File 'lib/versionator/git.rb', line 15 def git_tag git_command("git tag v#{version_name}") end |