Struct.new(:repo, :group_id, :artifact_id, :version)
# File lib/warbler/web_server.rb, line 8 def cached_path @cached_path ||= File.expand_path("~/.m2/repository/#{path_fragment}") end
# File lib/warbler/web_server.rb, line 12 def download_url @download_url ||= "#{repo}/#{path_fragment}" #:nocov: end
# File lib/warbler/web_server.rb, line 16 def local_path unless File.exist?(cached_path) puts "Downloading #{artifact_id}-#{version}.jar" #:nocov: FileUtils.mkdir_p File.dirname(cached_path) #:nocov: require 'open-uri' #:nocov: begin open(download_url) do |stream| #:nocov: File.open(cached_path, "wb") do |f| #:nocov: while buf = stream.read(4096) #:nocov: f << buf #:nocov: end #:nocov: end #:nocov: end #:nocov: rescue => e e.message.concat " - #{download_url}" raise e end end cached_path end
Generated with the Darkfish Rdoc Generator 2.