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 +5 -5
- data/lib/image_server/active_record.rb +6 -2
- data/lib/image_server/installer.rb +2 -2
- data/lib/image_server/uploader.rb +2 -3
- data/lib/image_server/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 89b8783d625a50ea1f70948afdc55bada3598c3b8ad48c3ce6afac6eec923b3d
|
4
|
+
data.tar.gz: 5e3a3cbb67af910b9cecfbc30d5a183eb6a97d53015004a7828c2c4a65804fe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
26
|
-
uploader = ImageServer::Uploader.new(#{namespace_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,
|
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('
|
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?
|
data/lib/image_server/version.rb
CHANGED
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.
|
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:
|
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.
|
136
|
+
rubygems_version: 2.7.6
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: ImageServer ruby client
|