Sha256: b77c075bd629dd479b2bc87de1283a28d9e2922acf99bff3f0df5859637b2e20

Contents?: true

Size: 357 Bytes

Versions: 3

Compression:

Stored size: 357 Bytes

Contents

require 'net/http'
require 'json'

module Thug
	class HttpClient
		
		def get_dependencies platform, gems
			uri = URI('http://13.95.24.166:1337/dependencies')
			res = Net::HTTP.post_form(uri, 'gems[]' => gems, 'platform' => platform)
			deps = JSON.parse(res.body)
			dependencies = deps.map do |dep|
				dep["name"]
			end

			dependencies
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thug-0.2.2 lib/thug/http_client.rb
thug-0.2.1 lib/thug/http_client.rb
thug-0.2.0 lib/thug/http_client.rb