Sha256: 5bcbdc2aa0934a90214e92288d5b35f6280e45f8186907475410ee534b176402

Contents?: true

Size: 885 Bytes

Versions: 23

Compression:

Stored size: 885 Bytes

Contents

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

class Commit < CommandArray
  def update
    if(Dir.exists?(".git") && `git config --list`.include?('user.name='))
	  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

23 entries across 23 versions & 1 rubygems

Version Path
dev_tasks-1.0.35 lib/commit.rb
dev_tasks-1.0.34 lib/commit.rb
dev_tasks-1.0.33 lib/commit.rb
dev_tasks-1.0.31 lib/commit.rb
dev_tasks-1.0.30 lib/commit.rb
dev_tasks-1.0.29 lib/commit.rb
dev_tasks-1.0.28 lib/commit.rb
dev_tasks-1.0.27 lib/commit.rb
dev_tasks-1.0.26 lib/commit.rb
dev_tasks-1.0.25 lib/commit.rb
dev_tasks-1.0.24 lib/commit.rb
dev_tasks-1.0.23 lib/commit.rb
dev_tasks-1.0.22 lib/commit.rb
dev_tasks-1.0.21 lib/commit.rb
dev_tasks-1.0.20 lib/commit.rb
dev_tasks-1.0.19 lib/commit.rb
dev_tasks-1.0.18 lib/commit.rb
dev_tasks-1.0.17 lib/commit.rb
dev_tasks-1.0.16 lib/commit.rb
dev_tasks-1.0.15 lib/commit.rb