Sha256: 009f01bc2d2e477bdf30f899856a36215bb8b6b642bc405938efb7b7ce8c21d6

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

module Dev
module Cmd
class DeepPull
  def self.execute

    puts "checking dependencies in #{DEV[:directory]}"
    # loop over each DEP with dir: NAME@REVISION format
    DEV[:dep].each {|key,value|
	  if(value.has_key?(:dir) && value[:dir].include?('@'))
	    
		# make sure working directory exist
		dep_wrk_dir="#{DEV[:dev_root]}/wrk/#{value[:dir].gsub(/@[\d]+/,'')}"
		dep_uri="#{value[:uri].gsub('@REV','')}"

		puts "#{dep_wrk_dir}"

		if(File.exists?(dep_wrk_dir))
		  Dir.chdir(dep_wrk_dir){|dir|
		    call=Dev::SystemCall.new('svn update')
			call.puts_summary
		  }
		else
		  call=Dev::SystemCall.new("svn co #{dep_uri} #{dep_wrk_dir}")
		  call.puts_summary
		end
	    
		Dir.chdir(dep_wrk_dir){ |dir|
		   original_text = File.read("#{dep_wrk_dir}/rakefile.rb")
		   call=Dev::SystemCall.new('rake deep_pull')
		   call.puts_summary
		   current_text = File.read("#{dep_wrk_dir}/rakefile.rb")
		   if(original_text != current_text)
			 call=Dev::SystemCall.new('rake setup')
			 call.puts_summary
		     call=Dev::SystemCall.new('rake default')
			 call.puts_summary
		   end
		}
	  end
	}

	# shallow pull in this 
	puts ""
	Pull.execute

  end
end # class DeepPull
end # module Cmd
end # module Dev

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dev-1.0.230 lib/dev/cmd/DeepPull.rb