cloudinary 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ pkg
3
3
  .rvmrc
4
4
  assets/
5
5
  vendor/assets/
6
+ Gemfile.lock
data/Rakefile CHANGED
@@ -1,4 +1,9 @@
1
1
  require 'bundler'
2
+
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task :default => :spec
6
+
2
7
  Bundler::GemHelper.install_tasks
3
8
 
4
9
  task :fetch_assets do
@@ -14,6 +14,7 @@ require "cloudinary/carrier_wave" if defined?(::CarrierWave)
14
14
  require "cloudinary/helper" if defined?(::ActionView::Base)
15
15
  require "cloudinary/controller" if defined?(::ActionController::Base)
16
16
  require "cloudinary/railtie" if defined?(Rails) && defined?(Rails::Railtie)
17
+ require "cloudinary/engine" if defined?(Rails) && defined?(Rails::Engine)
17
18
 
18
19
  module Cloudinary
19
20
  @@config = nil
@@ -1,5 +1,6 @@
1
1
  class Cloudinary::CarrierWave::Storage < ::CarrierWave::Storage::Abstract
2
2
  def store!(file)
3
+ return if !uploader.enable_processing
3
4
  if uploader.class.version_names.blank?
4
5
  case file
5
6
  when Cloudinary::CarrierWave::PreloadedCloudinaryFile
@@ -0,0 +1,2 @@
1
+ class Cloudinary::Engine < Rails::Engine
2
+ end
@@ -12,6 +12,7 @@ class Cloudinary::Uploader
12
12
  :format=>options[:format],
13
13
  :type=>options[:type],
14
14
  :backup=>options[:backup],
15
+ :invalidate=>options[:invalidate],
15
16
  :tags=>options[:tags] && Cloudinary::Utils.build_array(options[:tags]).join(",")}
16
17
  if options[:eager]
17
18
  params[:eager] = Cloudinary::Utils.build_array(options[:eager]).map do
@@ -27,7 +28,7 @@ class Cloudinary::Uploader
27
28
  def self.upload(file, options={})
28
29
  call_api("upload", options) do
29
30
  params = build_upload_params(options)
30
- if file.respond_to?(:read) || file =~ /^https?:/
31
+ if file.respond_to?(:read) || file =~ /^https?:/ || file =~ /^data:image\/\w*;base64,([a-zA-Z0-9\/+\n=]+)$/
31
32
  params[:file] = file
32
33
  else
33
34
  params[:file] = File.open(file, "rb")
@@ -41,7 +42,8 @@ class Cloudinary::Uploader
41
42
  {
42
43
  :timestamp=>Time.now.to_i,
43
44
  :type=>options[:type],
44
- :public_id=> public_id
45
+ :public_id=> public_id,
46
+ :invalidate=>options[:invalidate],
45
47
  }
46
48
  end
47
49
  end
@@ -37,7 +37,9 @@ class Cloudinary::Utils
37
37
  effect = Array(effect).flatten.join(":") if effect.is_a?(Array) || effect.is_a?(Hash)
38
38
 
39
39
  params = {:w=>width, :h=>height, :t=>named_transformation, :c=>crop, :b=>background, :e=>effect}
40
- { :x=>:x, :y=>:y, :r=>:radius, :d=>:default_image, :g=>:gravity, :q=>:quality, :p=>:prefix, :a=>:angle, :l=>:overlay, :u=>:underlay, :f=>:fetch_format }.each do
40
+ { :x=>:x, :y=>:y, :r=>:radius, :d=>:default_image, :g=>:gravity, :q=>:quality,
41
+ :p=>:prefix, :a=>:angle, :l=>:overlay, :u=>:underlay, :f=>:fetch_format, :dn=>:density, :pg=>:page
42
+ }.each do
41
43
  |param, option|
42
44
  params[param] = options.delete(option)
43
45
  end
@@ -1,4 +1,4 @@
1
1
  # Copyright Cloudinary
2
2
  module Cloudinary
3
- VERSION = "1.0.28"
3
+ VERSION = "1.0.29"
4
4
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cloudinary
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.28
5
+ version: 1.0.29
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nadav Soferman
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2012-07-03 00:00:00 +03:00
15
+ date: 2012-07-08 00:00:00 +03:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -65,6 +65,7 @@ files:
65
65
  - lib/cloudinary/carrier_wave/storage.rb
66
66
  - lib/cloudinary/controller.rb
67
67
  - lib/cloudinary/downloader.rb
68
+ - lib/cloudinary/engine.rb
68
69
  - lib/cloudinary/helper.rb
69
70
  - lib/cloudinary/migrator.rb
70
71
  - lib/cloudinary/missing.rb