Sha256: 393bd7de430a1a1c9732539e54436f6b2fc29b79901d1d68aa0e2630ef419869
Contents?: true
Size: 1.05 KB
Versions: 17
Compression:
Stored size: 1.05 KB
Contents
module Dev class Deps < Hash def refresh puts_debug "Dev::Deps.refresh" start_time=Time.now self.each{ |k,v| if !v.nil? && v.kind_of?(Hash) v[:dir]=get_dir(v) if !v.has_key?(:dir) v[:rev]=get_rev(v) if !v.has_key?(:rev) && !get_rev(v).nil? v[:uri]=get_uri(v) end } puts_debug "Deps refresh elapsed time " + (Time.now-start_time).to_s end def get_dir(h) uri=Dev::Environment.expand_string_variables(h[:uri]) uri_words=uri.split('/') while(uri_words.length > 3) do uri_words.shift end return uri_words.join('/') end def get_rev(h) if(h.has_key?(:uri) && h[:uri].include?('@') && !h[:uri].include?("@REV")) return h[:uri].split('@')[1] end if(h.has_key?(:dir) && h[:dir].include?('@') && !h[:dir].include?("@REV")) return h[:dir].split('@')[1] end nil end def get_uri(h) uri=h[:uri] if(uri.include?("@REV") && h.has_key?(:rev) && !h[:rev].nil?) uri=uri.gsub("@REV","@#{h[:rev]}") end return uri end end # class Deps end # module Dev
Version data entries
17 entries across 17 versions & 1 rubygems