Sha256: df1aac8b60a93a7f0c35ffe807a15223cbf6709343bc865949a8c555383275d5

Contents?: true

Size: 649 Bytes

Versions: 36

Compression:

Stored size: 649 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"'
	end
  end

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

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
dev_tasks-0.0.131 lib/commit.rb
dev_tasks-0.0.130 lib/commit.rb
dev_tasks-0.0.129 lib/commit.rb
dev_tasks-0.0.128 lib/commit.rb
dev_tasks-0.0.127 lib/commit.rb
dev_tasks-0.0.126 lib/commit.rb
dev_tasks-0.0.125 lib/commit.rb
dev_tasks-0.0.124 lib/commit.rb
dev_tasks-0.0.123 lib/commit.rb
dev_tasks-0.0.122 lib/commit.rb
dev_tasks-0.0.121 lib/commit.rb
dev_tasks-0.0.120 lib/commit.rb
dev_tasks-0.0.119 lib/commit.rb
dev_tasks-0.0.118 lib/commit.rb
dev_tasks-0.0.117 lib/commit.rb
dev_tasks-0.0.116 lib/commit.rb
dev_tasks-0.0.115 lib/commit.rb
dev_tasks-0.0.114 lib/commit.rb
dev_tasks-0.0.113 lib/commit.rb
dev_tasks-0.0.112 lib/commit.rb