Sha256: bdd9fcb47890cbf038415ca9f8efb37c4efe9e1e02c349884daa8b70aaf3aa9e

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require_relative('./environment.rb')

class Upgrade < Array

  def initialize
    update
  end

  def update
    if(Environment.scm=='git' && Environment.branch=='develop')
	  Dir.glob('dep/**/*.dll').each {|f|
	    src=Environment.dev_root + "/" + f
		if(File.exist?(src) && File.mtime(src) > File.mtime(f))
		  self.add "<%FileUtils.cp('#{src}','#{f}')%>"
		end
	  }
      if(defined?(DEV_TASKS))
        if(DEV_TASKS[:dependencies].has_key?(:source))
          DEV_TASKS[:dependencies][:source].each{|source_dep|

		    wrk=""
		    parts=source_dep.split('/develop/')
		    wrk=parts[0].gsub("/dep/","/wrk") if parts.length > 0
			self.add "<%rake('#{wrk}')%>" if(Dir.exists?(wrk))

	        dest = "./dep/#{File.basename(source_dep)}"

			if(!File.exists?(dest))
			  self.add "<%FileUtils.cp('#{source_dep}','#{dest}')%>"
			else
			   self.add "<%FileUtils.cp('#{source_dep}','#{dest}')%>" if(File.mtime(source_dep) > File.mtime(dest))
			end
		  }
	    end	  
	  end
	end
  end

  def add command
    self << command if(!include?(command))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dev_tasks-0.0.51 lib/upgrade.rb