Sha256: 5337d06c97f093a0d9a72b2dace21f2c9aebd75c8395c51fb5dd048ebfddf1e9

Contents?: true

Size: 868 Bytes

Versions: 11

Compression:

Stored size: 868 Bytes

Contents

# frozen_string_literal: true

namespace :git do
  desc "Run ssh-add to enter password for your ssh key a single time"
  task :setup do
    sh "ssh-add"
  end

  desc "Stage any deleted files to prepare for commit"
  task :delete do
    sh "git ls-files --deleted -z | xargs -0 git rm"
  end

  desc "Add files, commit them, push them"
  task :checkin do
    do_checkin
  end

  desc "Tests showing argument"
  task :show_arg, [:param1] do |_t, args|
    puts "Param1 is: #{args.param1}"
  end

  desc "Git Status"
  task :status do
    sh "git status"
  end

  def do_checkin
    print "Enter commit message to add, commit and push files, or blank to quit:\n"
    commit_message = STDIN.gets.chomp
    if commit_message.nil?
      print "Commit aborted."
      return
    end
    sh "git add ."
    sh "git commit -m\"#{commit_message}\""
    sh "git push"
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
stub_requests-0.1.11 lib/tasks/git.rake
stub_requests-0.1.10 lib/tasks/git.rake
stub_requests-0.1.9 lib/tasks/git.rake
stub_requests-0.1.8 lib/tasks/git.rake
stub_requests-0.1.7 lib/tasks/git.rake
stub_requests-0.1.6 lib/tasks/git.rake
stub_requests-0.1.5 lib/tasks/git.rake
stub_requests-0.1.4 lib/tasks/git.rake
stub_requests-0.1.3 lib/tasks/git.rake
stub_requests-0.1.2 lib/tasks/git.rake
stub_requests-0.1.1 lib/tasks/git.rake