Sha256: 30c894defeaa9f886a04ceeca996c1d32cc16a98d4e5ddc27ad3db0895ea4e09

Contents?: true

Size: 508 Bytes

Versions: 7

Compression:

Stored size: 508 Bytes

Contents

require 'git-utils/command'

class Sync < Command

  def parser
    OptionParser.new do |opts|
      opts.banner = "Usage: git sync [branch]"
      opts.on_tail("-h", "--help", "this usage guide") do
        puts opts.to_s; exit 0
      end
    end
  end

  # Returns a command appropriate for executing at the command line.
  def cmd
    branch = self.known_options.first || 'master'
    c = ["git checkout #{branch}"]
    c << "git pull"
    c << "git checkout #{current_branch}"
    c.join("\n")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
git-utils-2.1.0 lib/git-utils/sync.rb
git-utils-2.0.0 lib/git-utils/sync.rb
git-utils-1.0.0 lib/git-utils/sync.rb
git-utils-0.7.1 lib/git-utils/sync.rb
git-utils-0.7.0 lib/git-utils/sync.rb
git-utils-0.6.5 lib/git-utils/sync.rb
git-utils-0.6.4 lib/git-utils/sync.rb