Sha256: 07af7270230fc47f54e484d1137a96a734371fe16135423545e115d083da2b68
Contents?: true
Size: 442 Bytes
Versions: 25
Compression:
Stored size: 442 Bytes
Contents
#!/usr/bin/env ruby require 'yaml' env = ENV["POSTJOB_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" configs = YAML.load_file "config/database.yml" config = configs.fetch(env) { configs.fetch("defaults") } ENV["PGHOST"] = config["host"] ENV["PGPORT"] = config["port"] && config["port"].to_s ENV["PGUSER"] = config["username"] ENV["PGPASSWORD"] = config["password"] system "psql", "-d", config.fetch("database")
Version data entries
25 entries across 25 versions & 1 rubygems