jnicklas/carrierwave — pull request #956 by scottburton11 (2013-01-16 21:23:25+00:00)
Title: Fix an issue where an asset_host proc is not always called with an instance of Uploader

There is an issue with assigning a proc to the `asset_host` configuration attribute when fog is in use if you expect an instance of `Uploader` to be passed in every time.

`CarrierWave::Storage::Fog#public_url` calls `asset_host`: https://github.com/chaione/carrierwave/blob/master/lib/carrierwave/storage/fog.rb#L278

which is dynamically defined (like other config attributes) to call any proc assigned as its value: https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/uploader/configuration.rb#L96

and, as it happens, calls the proc without arguments. This means any call to `#url`, `#public_url`, `#to_s`, `#inspect` won't work if the proc relies on an argument, which breaks virtually any usage.

This patch ensures the dynamic config accessors pass `self` into any proc if it expects one or more arguments.

This allows the common usage of a CDN with predictable rotating cnames as such:
````
config.asset_host = proc do |file|
"http://assets%d.example.com" % (Zlib.crc32(file.filename) % 4)
end
````