cloudinary 1.0.19 → 1.0.20

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/lib/cloudinary.rb CHANGED
@@ -2,6 +2,7 @@
2
2
  require "ostruct"
3
3
  require "pathname"
4
4
  require "yaml"
5
+ require "uri"
5
6
  require "cloudinary/version"
6
7
  require "cloudinary/utils"
7
8
  require "cloudinary/uploader"
@@ -30,6 +31,15 @@ module Cloudinary
30
31
  "secure_distribution" => ENV["CLOUDINARY_SECURE_DISTRIBUTION"],
31
32
  "private_cdn" => ENV["CLOUDINARY_PRIVATE_CDN"].to_s == 'true'
32
33
  )
34
+ elsif first_time && ENV["CLOUDINARY_URL"]
35
+ uri = URI.parse(ENV["CLOUDINARY_URL"])
36
+ set_config(
37
+ "cloud_name" => uri.host,
38
+ "api_key" => uri.user,
39
+ "api_secret" => uri.password,
40
+ "private_cdn" => !uri.path.blank?,
41
+ "secure_distribution" => uri.path[1..-1]
42
+ )
33
43
  end
34
44
 
35
45
  set_config(new_config) if new_config
@@ -1,4 +1,4 @@
1
1
  # Copyright Cloudinary
2
2
  module Cloudinary
3
- VERSION = "1.0.19"
3
+ VERSION = "1.0.20"
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.19
5
+ version: 1.0.20
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-05-03 00:00:00 +03:00
15
+ date: 2012-05-06 00:00:00 +03:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency