Sha256: a194e3065e2ece2869d0e7fc080ed6f0815e0292914a000a6946a20c9d0d00ad

Contents?: true

Size: 848 Bytes

Versions: 1

Compression:

Stored size: 848 Bytes

Contents

if File.exists? Rails.root.join('.git')
  namespace :git do
    desc 'Git pull'
    task :pull do
      zfben_rails_rake_system 'git pull'
    end

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

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

    desc 'Clear files in .gitignore'
    task :clear do
      unless File.exists? Rails.root.join('.gitignore')
        zfben_rails_rake_err '.gitignore is not exists!'
      else
        zfben_rails_rake_system 'git clean -dfX'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zfben_rails_rake-0.0.19 lib/zfben_rails_rake/tasks/git.rb