lib/cloudinary/uploader.rb in cloudinary-1.0.44 vs lib/cloudinary/uploader.rb in cloudinary-1.0.45

- old
+ new

@@ -28,10 +28,13 @@ :image_metadata=>options[:image_metadata], :invalidate=>options[:invalidate], :eager=>build_eager(options[:eager]), :headers=>build_custom_headers(options[:headers]), :use_filename=>options[:use_filename], + :notification_url=>options[:notification_url], + :eager_notification_url=>options[:eager_notification_url], + :eager_async=>options[:eager_async], :tags=>options[:tags] && Cloudinary::Utils.build_array(options[:tags]).join(",")} params end def self.upload(file, options={}) @@ -95,10 +98,12 @@ result = call_api("sprite", options) do { :timestamp=>Time.now.to_i, :tag=>tag, + :async=>options[:async], + :notification_url=>options[:notification_url], :transformation => Cloudinary::Utils.generate_transformation_string(options.merge(:fetch_format=>options[:format])) } end if version_store == :file && result && result["version"] @@ -107,10 +112,36 @@ File.open("#{Rails.root}/tmp/cloudinary/cloudinary_sprite_#{tag}.version", "w"){|file| file.print result["version"].to_s} end end return result end + + def self.multi(tag, options={}) + call_api("multi", options) do + { + :timestamp=>Time.now.to_i, + :tag=>tag, + :format=>options[:format], + :async=>options[:async], + :notification_url=>options[:notification_url], + :transformation => Cloudinary::Utils.generate_transformation_string(options) + } + end + end + def self.explode(public_id, options={}) + call_api("explode", options) do + { + :timestamp=>Time.now.to_i, + :public_id=>public_id, + :type=>options[:type], + :format=>options[:format], + :notification_url=>options[:notification_url], + :transformation => Cloudinary::Utils.generate_transformation_string(options) + } + end + end + # options may include 'exclusive' (boolean) which causes clearing this tag from all other resources def self.add_tag(tag, public_ids = [], options = {}) exclusive = options.delete(:exclusive) command = exclusive ? "set_exclusive" : "add" return self.call_tags_api(tag, command, public_ids, options)