Sha256: ecb5b271be05f7c73871e1a251f655a652766a15779d3bfca405370996a5654a
Contents?: true
Size: 985 Bytes
Versions: 7
Compression:
Stored size: 985 Bytes
Contents
module Dev module Cmd class Pull def self.execute puts "checking dependencies in #{DEV[:directory]}" text = File.read("#{DEV[:directory]}/rakefile.rb") new_text = text DEV[:dep].each {|key,value| puts_debug "checking dep key #{key}" if(value.has_key?(:dir) && value[:dir].include?('@')) cmd="svn info #{value[:uri].gsub(/@[\d\w]+/,'')}" puts_debug cmd call=Dev::SystemCall.new(cmd) call.puts_summary info =call.output# %x[cmd] #puts_debug info new_revision = info.match(/Last Changed Rev: (?<rev>\d+)/)[:rev] new_dir = value[:dir].gsub(/@[\d]+/,"@#{new_revision}") puts_debug "new_dir=#{new_dir}" if(new_dir != value[:dir]) puts "updating from #{value[:dir]} to #{new_dir}" new_text = new_text.gsub(value[:dir],new_dir) end end } if(text != new_text) File.open("#{DEV[:directory]}/rakefile.rb",'w') { |f|f.write(new_text) } end end end # class Info end # module Cmd end # module Dev
Version data entries
7 entries across 7 versions & 1 rubygems