Sha256: 072220a04dcc60061db914720296f58bc42470e91d5c611e4638133936ad7c4c

Contents?: true

Size: 802 Bytes

Versions: 5

Compression:

Stored size: 802 Bytes

Contents

module Dev
module Cmd
class Commit < Array
  def refresh
	strip_auto_entries
	File.open('commit.message','w'){|f|f.puts "commit all"} if !File.exists?('commit.message')
	scm_type = get_default_scm_type
	if scm_type == "svn" 
	  self << "{:cmd=>'svn commit -F commit.message',:auto=>true}" 
	else
	  if scm_type == "git"
	    self << "{:cmd=>'git commit -a -F commit.message',:auto=>true}"
	  end
    end
  end

  def get_default_scm_type
    call=Dev::SystemCall.new("svn info")
	return "svn" if call.output.include?("Last Changed Date:")
    return "svn" if File.exists?(".svn")
	call=Dev::SystemCall.new("git status")
	return "git" if call.output.include?("#")
    return "git" if File.exists?(".git")
	return nil
  end
end	# class Compile
end # module Cmd
end # module Dev

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dev-1.0.207 lib/dev/cmd/Commit.rb
dev-1.0.206 lib/dev/cmd/Commit.rb
dev-1.0.205 lib/dev/cmd/Commit.rb
dev-1.0.204 lib/dev/cmd/Commit.rb
dev-1.0.203 lib/dev/cmd/Commit.rb