Sha256: d253ef80ed0b0e7e0ea8256c7f62233fa28b33e58f4f00a52c8f48e39588db1c

Contents?: true

Size: 1.72 KB

Versions: 8

Compression:

Stored size: 1.72 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

      include ReflectionUtils::CreateModuleFunctions
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
autowow-0.12.1 lib/autowow/commands/vcs.rb
autowow-0.12.0 lib/autowow/commands/vcs.rb
autowow-0.11.2 lib/autowow/commands/vcs.rb
autowow-0.11.1 lib/autowow/commands/vcs.rb
autowow-0.11.0 lib/autowow/commands/vcs.rb
autowow-0.10.1 lib/autowow/commands/vcs.rb
autowow-0.9.6 lib/autowow/commands/vcs.rb
autowow-0.9.5 lib/autowow/commands/vcs.rb