Sha256: 55f35ce45f9be9dc27ec0685dfd7b7f6cc8627d5161d4320673e14bd6d597d10

Contents?: true

Size: 750 Bytes

Versions: 1

Compression:

Stored size: 750 Bytes

Contents

module Versionator
  module Git
    def git_current_branch
      git_command("git branch").split(/\n/).grep(/\*/).first.gsub('* ', '')
    end

    def git_checkout(branch = 'master')
      git_command("git checkout #{branch}")
    end

    def git_pull(branch = 'master')
      git_command("git pull origin #{branch}")
    end

    def git_tag
      git_command("git tag v#{version_name}")
    end

    def git_commit(message = nil)
      message = "tag new release v#{version_name}" if message.blank?
      git_command("git commit -a -m '#{message}'")
    end
    
    def git_push(branch = 'master')
      git_command("git push origin #{branch} --tags")
    end
    
    def git_command(str)
      systemu(str).drop(1).join(" ")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
versionator-0.1.0 lib/versionator/git.rb