README.md in imgix-3.4.0 vs README.md in imgix-4.0.0

- old
+ new

@@ -46,40 +46,17 @@ Initialize a client with a `:domain` and your `:secure_url_token`. By default, HTTPS URLs are generated, but you can toggle that by passing `use_https: false`. Call `Imgix::Client#path` with the resource path to get an `Imgix::Path` object back. You can then manipulate the path parameters, and call `Imgix#Path#to_url` when you're done. -``` ruby +```rb client = Imgix::Client.new(domain: 'your-subdomain.imgix.net', secure_url_token: 'your-token') client.path('/images/demo.png').to_url(w: 200) #=> https://your-subdomain.imgix.net/images/demo.png?w=200&s=2eadddacaa9bba4b88900d245f03f51e - -# OR -path = client.path('/images/demo.png') -path.width = 200 -path.to_url - -# OR -client.path('/images/demo.png').width(200).height(300).to_url - -# Some other tricks -path.defaults.width(300).to_url # Resets parameters -path.rect(x: 0, y: 50, width: 200, height: 300).to_url # Rect helper ``` -**Deprecation Notice:** Usage of `:host` has been deprecated and will become invalid in the next major release. - -In the previous version, `:host` can be used to specify a domain for an `Imgix::Client` like so: - -```ruby -Imgix::Client.new(host: 'demo.imgix.net', secure_url_token: 'token') -``` - -Code using `:host` like the above will continue to work until the next major release. While using `:host` will remain valid until the next major release, its usage will result in a deprecation warning. In order to resolve these deprecation warnings before upgrading to the new release, use `:domain` instead of `:host`. - - ## Srcset Generation The imgix gem allows for generation of custom `srcset` attributes, which can be invoked through `Imgix::Path#to_srcset`. By default, the `srcset` generated will allow for responsive size switching by building a list of image-width mappings. ```rb @@ -216,24 +193,12 @@ https://testing.imgix.net/image.jpg?w=100&dpr=3&q=35 3x, https://testing.imgix.net/image.jpg?w=100&dpr=4&q=23 4x, https://testing.imgix.net/image.jpg?w=100&dpr=5&q=20 5x ``` -## Multiple Parameters - -When the imgix api requires multiple parameters you have to use the method rather than an accessor. - -For example to use the noise reduction: - -``` ruby -path.noise_reduction(50,50) -``` - ## Purge Cache -**Deprecation Notice:** The API keys used in `Imgix::Client#purge` version `3.3.X` have been deprecated. To utilize the updated `Imgix::Client#purge` method in version `4.0.0`, please regenerate your API key at `http://dashboard.imgix.com/api-keys`. Feel free to reach out to our [support line](support@imgix.com) if you have any questions or concerns. - -If you need to remove or update an image on imgix, you can purge it from our cache by initializing a client with your api_key, then calling Imgix::Client#purge with the resource path. +If you need to remove or update an image on imgix, you can purge it from our cache by initializing a client with your [API key](http://dashboard.imgix.com/api-keys), then calling `Imgix::Client#purge` with the resource path. ```ruby client = Imgix::Client.new(domain: 'your-subdomain.imgix.net', api_key: 'your-key') client.purge('/images/demo.png') ```