Sha256: a55cb625ad95fec96d8839a64b1850d622b1fa268e02a3c7991552038a73bf50

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

class Commit < Array

  def initialize
    if(Dir.exists?(".git"))
	  if(!`git status`.include?('nothing to commit') || `git status`.include?('untracked files present'))
	    if(File.exists?('commit.message') && File.read('commit.message').gsub(/\s+/, "").length > 0)
		  self.add "git commit -a -v -m \"#{File.read('commit.message')}\""
		  self.add "<%File.open('commit.message','w'){|f|f.write('')}%>"
		else
	      self.add 'git commit -a -v -m "commit all"'
		end
	  end
	end
	if(Dir.exists?(".svn"))
	  self.add 'svn commit -m"commit all"'
	  self.add "svn update"
	  selfadd "<%DEV_TASKS[:commands][:verify].update%>"
	end
  end

  def add command
    self << command if(!include?(command))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dev_tasks-0.0.133 lib/commit.rb