lib/imgix/client.rb in imgix-3.3.1 vs lib/imgix/client.rb in imgix-3.4.0
- old
+ new
@@ -42,11 +42,16 @@
p.ixlib("#{@library}-#{@version}") if @include_library_param
p
end
def purge(path)
- token_error = 'Authentication token required'
- raise token_error if @api_key.nil?
+ api_key_deprecated = \
+ "Warning: Your `api_key` will no longer work after upgrading to\n" \
+ "imgix-rb version >= 4.0.0.\n"
+ warn api_key_deprecated
+
+ api_key_error = 'A valid api key is required to send purge requests'
+ raise api_key_error if @api_key.nil?
url = new_prefix + path
uri = URI.parse('https://api.imgix.com/v2/image/purger')
user_agent = { 'User-Agent' => "imgix #{@library}-#{@version}" }