Sha256: 679434e052e1f5889449bf180d0f5364e60ab253ce9239d5c7e13fd212441a64

Contents?: true

Size: 1.9 KB

Versions: 1

Compression:

Stored size: 1.9 KB

Contents

module Autowow
  module Commands
    module Vcs
      def cmd
        ["git"]
      end

      def terminal_options
        ["--no-pager"]
      end

      def commit (msg)
        cmd + ["commit", "-m", msg]
      end

      def changes_not_on_remote(branch)
        cmd + terminal_options + ["log", branch, "--not", "--remotes"]
      end

      def branch_list
        cmd + ["for-each-ref", "--format=%(refname)", "refs/heads/"]
      end

      def push(branch = nil, remote = nil)
        cmd + ["push"] + [branch, remote].compact
      end

      def rebase(branch)
        cmd + ["rebase", branch]
      end

      def git_status
        cmd + ["status"]
      end

      def stash
        cmd + ["stash"]
      end

      def stash_pop
        cmd + ["stash", "pop"]
      end

      def current_branch
        cmd + ["symbolic-ref", "--short", "HEAD"]
      end

      def checkout(existing_branch)
        cmd + ["checkout", existing_branch]
      end

      def pull
        cmd + ["pull"]
      end

      def branch_force_delete(branch)
        cmd + ["branch", "-D", branch]
      end

      def create(branch)
        cmd + ["checkout", "-b", branch]
      end

      def set_upstream(remote, branch)
        cmd + ["push", "--set-upstream", remote, branch]
      end

      def remotes
        cmd + ["remote", "-v"]
      end

      def fetch(remote)
        cmd + ["fetch", remote]
      end

      def merge(compare)
        cmd + ["merge", compare]
      end

      def branch
        cmd + ["branch"]
      end

      def add_remote(name, url)
        cmd + ["remote", "add", name, url]
      end

      def add(patterns)
        cmd + ["add"] + patterns
      end

      def hard_reset(branch)
        cmd + ["reset", "--hard"] + branch
      end

      include ReflectionUtils::CreateModuleFunctions
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
autowow-0.13.0 lib/autowow/commands/vcs.rb