Class: Spectro::HTTPClient

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Singleton
Defined in:
lib/spectro/http_client.rb

Overview

Interact with the API exchanging specs and functions

Instance Method Summary collapse

Instance Method Details

#upload_undefined_specsObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/spectro/http_client.rb', line 13

def upload_undefined_specs
  uri = URI.parse('http://' + Spectro::Config.api_hostname + '/api/specs')
  file_path = '.spectro/undefined.yml'

  http = Net::HTTP.new(uri.host, uri.port)
  request = Net::HTTP::Post.new(uri.request_uri)
  request.body = File.read(file_path)

  http.request(request)
end