image_server 0.5.0 → 0.8.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
- SHA1:
3
- metadata.gz: 9147befb6357ed6c9e3b160794ebc46b535a4ee2
4
- data.tar.gz: 8be91bbfa024ee310ce5286129b9c07275491eb7
2
+ SHA256:
3
+ metadata.gz: 89b8783d625a50ea1f70948afdc55bada3598c3b8ad48c3ce6afac6eec923b3d
4
+ data.tar.gz: 5e3a3cbb67af910b9cecfbc30d5a183eb6a97d53015004a7828c2c4a65804fe0
5
5
  SHA512:
6
- metadata.gz: f13101ae69fc6dbc1c2d80cc608d37ef38d79f901b0cce96fdb2bcd2f86f415585df3c094d75f68d08c38b747594c4d288117e0aadf1ed0b0961c99b87bbbb95
7
- data.tar.gz: 62d26cd64e71734efa59f17201e2fc9ff55439c8ef8be5871e3b66a5616c235f3b0b35ed7bd087f5324c7f213dc8b7f24577bfe8cc967af9d4ceb69b3c683cb5
6
+ metadata.gz: '0806331f83fb44412a130de9962de61151e0cb1ec3b22638e14efd170a8111e725dd65edd1311c38aaa7d663e14ff5b1165a784169be76d751779f6bc099ba4b'
7
+ data.tar.gz: 89f9763044b5b0746829f6578fa132d643e9ca72a8a1a0401fa4354cc02db865ecb86d939fc1e00c599acdc622883734ec24aa1ab22281b8189dc5d2b25d6d73
@@ -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,
@@ -37,7 +37,7 @@ module ImageServer
37
37
  end
38
38
 
39
39
  def current_version
40
- '1.17.0'
40
+ '1.18.0'
41
41
  end
42
42
 
43
43
  def executable_name
@@ -58,4 +58,4 @@ module ImageServer
58
58
  configuration.path_to_binary
59
59
  end
60
60
  end
61
- end
61
+ end
@@ -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,
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'])
@@ -49,7 +48,7 @@ module ImageServer
49
48
 
50
49
  def existing_image_property
51
50
  return unless url
52
- @existing_image_property ||= ImageProperty.where(namespace: @namespace).where('lower(image_url) = lower(?)', url).first
51
+ @existing_image_property ||= ImageProperty.where(namespace: @namespace).where('image_url = ?', url.downcase).first
53
52
  end
54
53
 
55
54
  def source_is_url?
@@ -1,3 +1,3 @@
1
1
  module ImageServer
2
- VERSION = '0.5.0'
2
+ VERSION = '0.8.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Millan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-26 00:00:00.000000000 Z
11
+ date: 2021-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.4.5.1
136
+ rubygems_version: 2.7.6
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: ImageServer ruby client