image_server 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4aa3d8f55d83cd57905953a697e417fdc621d7d
4
- data.tar.gz: 855191bc4f6392ca90287bf0ba6a9a1199371bf4
3
+ metadata.gz: fa5a91e0a600999e6d1e01b7b504f8ea0a9edffd
4
+ data.tar.gz: 7be9fbc41bde26fe3af5bedfce7b348e73c39d6f
5
5
  SHA512:
6
- metadata.gz: 1065e495a60c8cfd53d8a3dd21e3c8e35aa60374532126f24fa10acc22d61e8cd54a65cbacf8550e3d9ab7f207b6d334948fe65d17369083b2fa09da1b197f20
7
- data.tar.gz: e24fed8dca503869a7d1156758d1f8584f6a3d18047d21062f2aa86ee8e5277aa630edd0936d00fa104e05c35684ab194e5093f593ebce47f8e3ca41de32f955
6
+ metadata.gz: c25467774fa0e74d476755166e32b761d8be31e00a005c1e5f989eb4d89155688b91397d2ae0fc1c33b2c208810c5b7ffb4d72d2acc7489b86be847021cf1854
7
+ data.tar.gz: ba9e7fd9ef2c53e314ca6a36c526a572dd5e8466dbaafaaf58b6b73fd586f8027b7684e3b83fd67358368d43d63d088081a7474a1844f79c79e905b5c9cc5472
@@ -22,12 +22,16 @@ module ImageServer
22
22
  #{processing_versions_constant} = #{processing_versions}
23
23
  #{sharded_cdn_template_constant} = #{sharded_cdn_template}
24
24
 
25
- def remote_#{column}_url=(url)
26
- uploader = ImageServer::Uploader.new(#{namespace_constant}, url, #{outputs_constant})
25
+ def #{column}=(source)
26
+ uploader = ImageServer::Uploader.new(#{namespace_constant}, source, #{outputs_constant})
27
27
  image_property = uploader.upload
28
28
  self.#{column}_hash = image_property.image_hash
29
29
  end
30
30
 
31
+ def remote_#{column}_url=(url)
32
+ self.#{column} = url
33
+ end
34
+
31
35
  def #{column}(options={})
32
36
  default_options = { protocol: #{column}_cdn_protocol,
33
37
  domain: #{column}_cdn_domain,
@@ -30,11 +30,10 @@ module ImageServer
30
30
  end
31
31
 
32
32
  def find_or_create_image_property(properties)
33
- return unless url
34
33
  attributes = {
35
34
  width: properties['width'],
36
35
  height: properties['height'],
37
- image_url: url.downcase,
36
+ image_url: (url.downcase if url),
38
37
  namespace: @namespace
39
38
  }
40
39
  ip = ImageProperty.where(image_hash: properties['hash'], namespace: @namespace).first || ImageProperty.new(image_hash: properties['hash'])
@@ -1,3 +1,3 @@
1
1
  module ImageServer
2
- VERSION = '0.6.1'
2
+ VERSION = '0.7.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Millan