Sha256: 50c839d00c4419e23c3b06c15d77ffee7abb79e6fc078195f4fb8a27cfedd27b
Contents?: true
Size: 938 Bytes
Versions: 3
Compression:
Stored size: 938 Bytes
Contents
require 'uri' require 'thread' module ASF class SVN @base = URI.parse('https://svn.apache.org/repos/') @mock = 'file:///var/tools/svnrep/' @semaphore = Mutex.new def self.repos @semaphore.synchronize do @repos ||= Hash[Dir[*ASF::Config.get(:svn)].map { |name| Dir.chdir name.untaint do [`svn info`[/URL: (.*)/,1].sub(/^http:/,'https:'), Dir.pwd.untaint] end }] end end def self.[](name) result = repos[(@mock+name.sub('private/','')).to_s.sub(/\/*$/, '')] || repos[(@base+name).to_s.sub(/\/*$/, '')] # lose trailing slash return result if result # recursively try parent directory if name.include? '/' base = File.basename(name) result = self[File.dirname(name)] if result and File.exist?(File.join(result, base)) File.join(result, base) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
whimsy-asf-0.0.4 | lib/whimsy/asf/svn.rb |
whimsy-asf-0.0.3 | lib/whimsy/asf/svn.rb |
whimsy-asf-0.0.2 | lib/whimsy/asf/svn.rb |