Sha256: b21bb1063873e8fe5ca92eb07feeaf6d00bb33b8010836e24d5743cdcb248948
Contents?: true
Size: 1.67 KB
Versions: 2
Compression:
Stored size: 1.67 KB
Contents
module Dev class Scm attr_accessor :scm_type def initialize @scm_type="none" call=Dev::SystemCall.new("svn info") @scm_type="svn" if call.output.include?("Last Changed Date:") @scm_type="svn" if File.exists?(".svn") @scm_type="git" if File.exists?(".git") end def file_tracked?(file) if @scm_type=="git" call=Dev::SystemCall.new("git ls-files #{file} -error_unmatch") return true if call.status==0 end false end def add_file(file) call=Dev::SystemCall.new("git add #{file}") if @scm_type=="git" if @scm_type=="svn" afile=file afile="#{file}@" if afile.include?('@') `svn info "#{afile}"` status=$?.exitstatus if(status != 0) call=Dev::SystemCall.new("svn add \"#{afile}\" --parents") call.puts_summary end end end def add_file_glob(glob) Dir.glob(glob).each { |f| if(!f.include?("/obj/") && !f.include?("/bin/") && !f.include?("/TestOutput/") && f.index("obj/") != 0 && f.index("bin/") != 0 ) add_file(f) end } end def self.export(remote,local,scm) puts_debug "Scm.export, scm=#{scm}" if remote.include?("svn:") || scm=="svn" local_tmp=local.gsub('@','-') call=Dev::SystemCall.new("svn export \"#{remote}\" \"#{local_tmp}\"") call.puts_summary if(local_tmp != local) sleep 15 File.rename(local_tmp,local) if File.exist?(local_tmp) sleep 15 end end if scm=="git" call=Dev::SystemCall.new("git clone #{remote} #{local}") end end def self.update(local) end end # class Scm end # module Dev
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dev-1.0.199 | lib/dev/Scm.rb |
dev-1.0.198 | lib/dev/Scm.rb |