Sha256: dc633b6bc6630b387797be0b81c898e42202ede2a95bb1b1fba7e388dfe56297

Contents?: true

Size: 818 Bytes

Versions: 11

Compression:

Stored size: 818 Bytes

Contents

require_relative('./commandarray.rb')
require_relative('./environment.rb')

class Commit < CommandArray
  def update
    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"
	  self.add '<%puts "Last Changed Rev: " + Environment.svn_latest_revision%>'
	  self.add "<%DEV_TASKS[:commands][:verify].update%>"
	end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dev_tasks-1.0.0 lib/commit.rb
dev_tasks-0.0.166 lib/commit.rb
dev_tasks-0.0.164 lib/commit.rb
dev_tasks-0.0.163 lib/commit.rb
dev_tasks-0.0.162 lib/commit.rb
dev_tasks-0.0.161 lib/commit.rb
dev_tasks-0.0.160 lib/commit.rb
dev_tasks-0.0.159 lib/commit.rb
dev_tasks-0.0.158 lib/commit.rb
dev_tasks-0.0.157 lib/commit.rb
dev_tasks-0.0.156 lib/commit.rb