Sha256: 9407c5f4f044fefb5fec7244168f15ae7dcb212617129df4cf19df79bbd1d7de

Contents?: true

Size: 826 Bytes

Versions: 3

Compression:

Stored size: 826 Bytes

Contents

module RakeRoll

  module GitCommands

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

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

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

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

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

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

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

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rake_roll-0.1.5 lib/rake_roll/git_commands.rb
rake_roll-0.1.4 lib/rake_roll/git_commands.rb
rake_roll-0.1.3 lib/rake_roll/git_commands.rb