acbaker 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acbaker/asset_pack.rb +7 -5
- data/lib/acbaker/processors.rb +2 -1
- data/lib/acbaker/processors/constraint.rb +18 -0
- data/lib/acbaker/processors/contain.rb +1 -1
- data/lib/acbaker/version.rb +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2addf8779a1ba8dda726042891ff5ed78ff92ead
|
4
|
+
data.tar.gz: 82fc094482817ceff0be7435718e2f45f54de2d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b62cb0ac49dbe7c9ab7afdbdcc7635ef98985642c073d90245f4432369de7cee2d47a3dbc5e867d1f21a4e5918de506b681f04e6e288ad1f105996da0f4bbf4b
|
7
|
+
data.tar.gz: 4f1b0840193f2f06ac7bcf5778f6639b2d33755d34e9d260db31e8ec8fa82927f0f9003327542ba82d8afe4eb1abe92bede2cf97280342c88582e7f693dca004
|
data/lib/acbaker/asset_pack.rb
CHANGED
@@ -68,6 +68,11 @@ module Acbaker
|
|
68
68
|
version = 'ios56'
|
69
69
|
end
|
70
70
|
|
71
|
+
# process image
|
72
|
+
@processors.each do |processor|
|
73
|
+
image = processor.run(image, image_spec, width, height)
|
74
|
+
end
|
75
|
+
|
71
76
|
# Generate filename
|
72
77
|
filename_array = []
|
73
78
|
filename_array.push(@type)
|
@@ -97,11 +102,8 @@ module Acbaker
|
|
97
102
|
else
|
98
103
|
filename = "#{filename_array.join('-')}.png"
|
99
104
|
end
|
100
|
-
|
101
|
-
#
|
102
|
-
@processors.each do |processor|
|
103
|
-
image = processor.run(image, image_spec, width, height)
|
104
|
-
end
|
105
|
+
|
106
|
+
# save image
|
105
107
|
image.write("#{target_directory}/#{filename}")
|
106
108
|
|
107
109
|
# Trigger Callback proc
|
data/lib/acbaker/processors.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Acbaker
|
2
|
+
module Processors
|
3
|
+
class Constraint < Base
|
4
|
+
@@defaults = {}
|
5
|
+
|
6
|
+
def run(image, image_spec, width=nil, height=nil)
|
7
|
+
# resize image
|
8
|
+
image.change_geometry("#{width}x#{height}") do |px, py, i|
|
9
|
+
image.resize!(px, py)
|
10
|
+
image_spec['size'] = "#{px}x#{py}"
|
11
|
+
end
|
12
|
+
|
13
|
+
image
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/acbaker/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Acbaker
|
2
|
-
VERSION = "0.0.
|
3
|
-
end
|
2
|
+
VERSION = "0.0.8"
|
3
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acbaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Strebitzer
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/acbaker/processors.rb
|
95
95
|
- lib/acbaker/processors/base.rb
|
96
96
|
- lib/acbaker/processors/center.rb
|
97
|
+
- lib/acbaker/processors/constraint.rb
|
97
98
|
- lib/acbaker/processors/contain.rb
|
98
99
|
- lib/acbaker/processors/cover.rb
|
99
100
|
- lib/acbaker/version.rb
|