Sha256: 737ba00f357388b01b2a06d4f8b30a487d84493cb1b751f2ff5ff37b9cc676f5
Contents?: true
Size: 1.19 KB
Versions: 10
Compression:
Stored size: 1.19 KB
Contents
if(RUBY_VERSION != "1.8.7") 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] new_revision="0" if(RUBY_VERSION=="1.8.7") info.each_line do |line| if(line.include?("Last Changed Rev:")) new_revision=line.split(':')[1].strip end end else new_revision = info.match(/Last Changed Rev: (?<rev>\d+)/)[:rev] end 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 end
Version data entries
10 entries across 10 versions & 1 rubygems