ryandotsmith/queue_classic — pull request #114 by jperville (2012-11-21 11:41:16+00:00)
Title: Allow percent-encoded socket paths in ENV[{QC_,}DATABASE_URL]

Since PostgreSQL 9.2, percent-encoded *socket paths* are allowed in the *host* part of the connection string URI [source](http://www.postgresql.org/docs/9.2/interactive/libpq-connect.html).

This PR allows the following style of `PG_DATABASE_URL` or `DATABASE_URL` environment variables:

DATABASE_URL='postgresql://username:password@%2Fvar%2Frun%2Fpostgresql/dbname'

I have manually tested using the Rails console that this style of database URL is compatible with both `queue_classic` and `ActiveRecord` using the following simple commands:

```ruby
puts ENV['QC_DATABASE_URL']
puts QC::Conn.connection.exec('select current_timestamp').to_a.inspect
ActiveRecord::Base.establish_connection ENV['QC_DATABASE_URL']
puts ActiveRecord::Base.connection.raw_connection.exec('select current_timestamp').to_a
```

This PR solves issue #72.