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