Sha256: 6d635f76cbdff24d8e58b7b93d4bd5d15f6ae3de6c5e52170bca2d73871dda63

Contents?: true

Size: 839 Bytes

Versions: 12

Compression:

Stored size: 839 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'))
	    # skip
	  else
	    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

12 entries across 12 versions & 1 rubygems

Version Path
dev_tasks-1.0.11 lib/commit.rb
dev_tasks-1.0.10 lib/commit.rb
dev_tasks-1.0.9 lib/commit.rb
dev_tasks-1.0.8 lib/commit.rb
dev_tasks-1.0.7 lib/commit.rb
dev_tasks-1.0.6 lib/commit.rb
dev_tasks-1.0.5 lib/commit.rb
dev_tasks-1.0.4 lib/commit.rb
dev_tasks-1.0.3 lib/commit.rb
dev_tasks-1.0.2 lib/commit.rb
dev_tasks-1.0.1 lib/commit.rb
dev_tasks-0.0.167 lib/commit.rb