Parent

Heroku::Kensa::Manifest

Constants

REGIONS

Public Class Methods

new(options = {}) click to toggle source
# File lib/heroku/kensa/manifest.rb, line 8
def initialize(options = {})
  @method   = options.fetch(:method, 'post').to_sym
  @filename = options[:filename]
  @options  = options
end

Public Instance Methods

foreman() click to toggle source
# File lib/heroku/kensa/manifest.rb, line 57
def foreman
  SSO_SALT=#{@sso_salt}HEROKU_USERNAME=myaddonHEROKU_PASSWORD=#{@password}
end
get_skeleton() click to toggle source
# File lib/heroku/kensa/manifest.rb, line 20
def get_skeleton
  {  "id": "myaddon",  "api": {    "config_vars": [ "MYADDON_URL" ],    "regions": [ "us" ],    "password": "#{@password}",#{ sso_key }    "production": "https://yourapp.com/",    "test": "http://localhost:#{@port}/"  }}
end
post_skeleton() click to toggle source
# File lib/heroku/kensa/manifest.rb, line 35
def post_skeleton
  {  "id": "myaddon",  "api": {    "config_vars": [ "MYADDON_URL" ],    "regions": [ "us" ],    "password": "#{@password}",#{ sso_key }    "production": {      "base_url": "https://yourapp.com/heroku/resources",      "sso_url": "https://yourapp.com/sso/login"    },    "test": {      "base_url": "http://localhost:#{@port}/heroku/resources",      "sso_url": "http://localhost:#{@port}/sso/login"    }  }}

end
skeleton() click to toggle source
# File lib/heroku/kensa/manifest.rb, line 65
def skeleton
  OkJson.decode skeleton_json
end
skeleton_json() click to toggle source
# File lib/heroku/kensa/manifest.rb, line 14
def skeleton_json
  @password = generate_password(16)
  @port     = @options[:foreman] ? 5000 : 4567
  (@method == :get) ? get_skeleton : post_skeleton
end
write() click to toggle source
# File lib/heroku/kensa/manifest.rb, line 69
def write
  File.open(@filename, 'w') { |f| f << skeleton_json }
  File.open('.env', 'w') { |f| f << foreman } if @options[:foreman]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.