Sha256: 03e88bec6d026a2bad89cad1f0b380c40e4610dccb0c32a5a3dd882bc4ce4f13

Contents?: true

Size: 848 Bytes

Versions: 13

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

13 entries across 13 versions & 2 rubygems

Version Path
h2ocube_rails_tasks-0.0.9 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.8 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.7 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.6 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.5 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.4 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.3 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.2 lib/h2ocube_rails_tasks/tasks/git.rb
h2ocube_rails_tasks-0.0.1 lib/h2ocube_rails_tasks/tasks/git.rb
zfben_rails_rake-0.0.23 lib/zfben_rails_rake/tasks/git.rb
zfben_rails_rake-0.0.22 lib/zfben_rails_rake/tasks/git.rb
zfben_rails_rake-0.0.21 lib/zfben_rails_rake/tasks/git.rb
zfben_rails_rake-0.0.20 lib/zfben_rails_rake/tasks/git.rb