module Heroku::Helpers::HerokuPostgresql
Public Instance Methods
hpg_resolve(identifier, default=nil)
click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 37 def hpg_resolve(identifier, default=nil) $stderr.puts " ! #hpg_resolve is deprecated. Please run `heroku plugins:update` to update your plugins." $stderr.puts " ! from: #{caller.first}" Resolver.new(app, api).resolve(identifier , default) end
hpg_translate_db_opts_to_urls(addon, config)
click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 184 def hpg_translate_db_opts_to_urls(addon, config) app_name = app rescue nil resolver = Resolver.new(app_name, api) if addon =~ /^#{resolver.hpg_addon_name}/ %w[fork follow rollback].each do |opt| if val = config[opt] unless val.is_a?(String) error("--#{opt} requires a database argument.") end uri = URI.parse(val) rescue nil if uri && uri.scheme && uri.scheme == 'postgres' argument_url = uri.to_s else attachment = resolver.resolve(val) if attachment.starter_plan? error("#{opt.tr 'f', 'F'} is only available on production databases.") end argument_url = attachment.url end config[opt] = argument_url end end end end
hpg_translate_fork_and_follow(addon, config)
click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 179 def hpg_translate_fork_and_follow(addon, config) $stderr.puts " ! #hpg_translate_fork_and_follow is deprecated. Update your plugins." hpg_translate_db_opts_to_urls(addon, config) end
Private Instance Methods
hpg_promote(url)
click to toggle source
# File lib/heroku/helpers/heroku_postgresql.rb, line 213 def hpg_promote(url) api.put_config_vars(app, "DATABASE_URL" => url) end