Sha256: 97c239c4db7b64fcd4d60909d0db789d47804b65a71dfceeeaba112e0ab2765b

Contents?: true

Size: 1.43 KB

Versions: 6

Compression:

Stored size: 1.43 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
	    
		if(value.has_key?(:rake))
		  task=value[:rake]
		  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
			 call=Dev::SystemCall.new('rake pull')
		     call.puts_summary
		     current_text = File.read("#{dep_wrk_dir}/rakefile.rb")
		     if(original_text != current_text)
			   if(task=='default')
			     call=Dev::SystemCall.new('rake setup')
			     call.puts_summary2(false)
			   end
		       call=Dev::SystemCall.new("rake #{task}")
			   call.puts_summary
		     end
		  }
		end
	  end
	}

	# shallow pull in this 
	puts ""
	Pull.execute

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dev-1.0.247 lib/dev/cmd/DeepPull.rb
dev-1.0.246 lib/dev/cmd/DeepPull.rb
dev-1.0.245 lib/dev/cmd/DeepPull.rb
dev-1.0.244 lib/dev/cmd/DeepPull.rb
dev-1.0.243 lib/dev/cmd/DeepPull.rb
dev-1.0.242 lib/dev/cmd/DeepPull.rb