Sha256: 8f9b848e6ec36915f46fc8a0a430634a37752b47bc638baff29db01c75a0febb

Contents?: true

Size: 716 Bytes

Versions: 5

Compression:

Stored size: 716 Bytes

Contents

if File.exists?(ROOT + '/.git')
  namespace :git do  
    desc 'Git pull'
    task :pull do
      sys 'git pull'
    end

    desc 'Git commit with your comment'
    task :commit, [:comment] do |task, args|
      args = args.to_hash
      sys "git add ."
      comment = args.has_key?(:comment) ? args[:comment] : `git status`
      sys "git commit -m '#{comment}' -a"
    end

    desc 'Git push with your comment'
    task :push, [:comment] => [:commit] do |task, comment|
      sys 'git push'
    end

    desc 'Clear files in .gitignore'
    task :clear do
      unless File.exists? ROOT + '/.gitignore'
        err '.gitignore is not exists!'
      else
        sys 'git clean -dfX'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zfben_rails_rake-0.0.18 lib/zfben_rails_rake/tasks/git.rb
zfben_rails_rake-0.0.17 lib/zfben_rails_rake/tasks/git.rb
zfben_rails_rake-0.0.16 lib/zfben_rails_rake/tasks/git.rb
zfben_rails_rake-0.0.15 lib/zfben_rails_rake/tasks/git.rb
zfben_rails_rake-0.0.14 lib/zfben_rails_rake/tasks/git.rb