Class: MavenRemote

Inherits:
Object
  • Object
show all
Defined in:
lib/j/repos.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ MavenRemote

Returns a new instance of MavenRemote.



78
79
80
# File 'lib/j/repos.rb', line 78

def initialize(url)
    @url = url
end

Instance Method Details

#get(coordinates) ⇒ Object



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/j/repos.rb', line 82

def get(coordinates)
    uri = URI(@url + "/" + coordinates.relative_url)

    response = HTTParty.get(uri)

    if response.code != 200
        raise "Error getting #{uri} response code #{response.code}"
    end

    response.body
end