Sha256: df712ae83a2cf6378e5a74dcb75e3c37d06409f8921ac431273b76f3810fdda7
Contents?: true
Size: 1.19 KB
Versions: 2
Compression:
Stored size: 1.19 KB
Contents
class HaxeLib < Rake::FileTask class << self def home `haxelib config`.chomp end def spec_to_path spec id, version = spec.split(":") File.join( home, id, version.gsub(".",",") ) end def path_to_spec path id, version = path.gsub(home,"").split(File::SEPARATOR) return nil unless id && version && path.include?(home) {:id => id, :version => version.gsub(",",".")} end def lookup spec id, version = spec.split(":") task = HaxeLib.define_task( spec_to_path spec ) task.id = id task.version = version task end end attr_accessor :id, :version def initialize(*args) super enhance do |task| task.enhance do if download_needed? info "Downloading #{to_spec}" download end end end end def download fail( "Could not download #{to_spec}") unless system "haxelib install #{id} #{version}" end def download_needed? !File.exists?(name) end def to_spec "#{id}:#{version}" end def to_spec_hash {:id => @id, :version => @version} end end module Buildr def haxelib spec haxelib = HaxeLib.lookup(spec) haxelib end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
buildr-hx-0.0.9.pre | lib/buildr/hx/core/haxe_lib.rb |
buildr-hx-0.0.8.pre | lib/buildr/hx/core/haxe_lib.rb |