Module: Kr

Defined in:
lib/kr.rb,
lib/kr/version.rb

Constant Summary collapse

VERSION =
'0.0.3'

Class Method Summary collapse

Class Method Details

.configure_netrcObject

TODO: Yeah we should probably be more helpful



18
19
20
# File 'lib/kr.rb', line 18

def self.configure_netrc
  puts "Please configure your netrc for Heroku!"
end

.connectObject



8
9
10
11
12
13
14
15
# File 'lib/kr.rb', line 8

def self.connect
  username, token = Netrc.read["api.heroku.com"]
  configure_netrc if [username, token].any?(&:nil?)
  username = CGI.escape(username)
  url = "https://#{username}:#{token}@api.heroku.com/schema"
  options = {default_headers: {'Accept' => 'application/vnd.heroku+json; version=3'}}
  Heroics.client_from_schema_url(url, options)
end