acbaker 1.0.0 → 2.0.0
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.
- checksums.yaml +5 -5
- data/.rubocop.yml +73 -8
- data/Gemfile.lock +41 -36
- data/acbaker.gemspec +1 -1
- data/lib/acbaker/asset_pack.rb +3 -2
- data/lib/acbaker/processors/center.rb +2 -4
- data/lib/acbaker/processors/contain.rb +1 -3
- data/lib/acbaker/processors/cover.rb +1 -3
- data/lib/acbaker/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 48bc435fe2f091ac41f92db9b3ceb0442ac40ef3a8267d88b89a929f51e995ea
|
4
|
+
data.tar.gz: af9958ef2aa4a6fa0ca1b1564628610eaca49b9792ebcb07649dc12f5f158968
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 607ceae4931cef50443dd2bfaa4409ca8458fe334f559c7efb9a054304ae85a92d3bb7bb166922a91b2224ee0df6324e33bba9663305babbd9950c254c9cb0e1
|
7
|
+
data.tar.gz: 946b6f6d02c5aac0568d5e238b4ae60160c2d2bb54e3259cf7311011f1412fca2442ea13151e18e435a8e30a2f9cbb7de6359c63249fb91eb8062baffae3ee83
|
data/.rubocop.yml
CHANGED
@@ -6,10 +6,6 @@ Style/SymbolArray:
|
|
6
6
|
Style/ClassCheck:
|
7
7
|
EnforcedStyle: kind_of?
|
8
8
|
|
9
|
-
# It's better to be more explicit about the type
|
10
|
-
Style/BracesAroundHashParameters:
|
11
|
-
Enabled: false
|
12
|
-
|
13
9
|
Style/TernaryParentheses:
|
14
10
|
Enabled: true
|
15
11
|
EnforcedStyle: require_parentheses_when_complex
|
@@ -20,10 +16,10 @@ Lint/UselessAssignment:
|
|
20
16
|
- '**/spec/**/*'
|
21
17
|
|
22
18
|
# We could potentially enable the 2 below:
|
23
|
-
Layout/
|
19
|
+
Layout/FirstHashElementIndentation:
|
24
20
|
Enabled: false
|
25
21
|
|
26
|
-
Layout/
|
22
|
+
Layout/HashAlignment:
|
27
23
|
Enabled: false
|
28
24
|
|
29
25
|
# HoundCI doesn't like this rule
|
@@ -38,7 +34,7 @@ Style/NumericPredicate:
|
|
38
34
|
Enabled: false
|
39
35
|
|
40
36
|
# Sometimes we allow a rescue block that doesn't contain code
|
41
|
-
Lint/
|
37
|
+
Lint/SuppressedException:
|
42
38
|
Enabled: false
|
43
39
|
|
44
40
|
Style/RescueStandardError:
|
@@ -185,8 +181,77 @@ Style/ClassVars:
|
|
185
181
|
Style/FrozenStringLiteralComment:
|
186
182
|
Enabled: false
|
187
183
|
|
184
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
185
|
+
Enabled: true
|
186
|
+
|
187
|
+
Layout/SpaceAroundMethodCallOperator:
|
188
|
+
Enabled: true
|
189
|
+
|
190
|
+
Lint/DeprecatedOpenSSLConstant:
|
191
|
+
Enabled: true
|
192
|
+
|
193
|
+
Lint/DuplicateElsifCondition:
|
194
|
+
Enabled: true
|
195
|
+
|
196
|
+
Lint/MixedRegexpCaptureTypes:
|
197
|
+
Enabled: true
|
198
|
+
|
199
|
+
Lint/RaiseException:
|
200
|
+
Enabled: true
|
201
|
+
|
202
|
+
Lint/StructNewOverride:
|
203
|
+
Enabled: true
|
204
|
+
|
205
|
+
Style/AccessorGrouping:
|
206
|
+
Enabled: true
|
207
|
+
|
208
|
+
Style/ArrayCoercion:
|
209
|
+
Enabled: true
|
210
|
+
|
211
|
+
Style/BisectedAttrAccessor:
|
212
|
+
Enabled: true
|
213
|
+
|
214
|
+
Style/CaseLikeIf:
|
215
|
+
Enabled: true
|
216
|
+
|
217
|
+
Style/ExponentialNotation:
|
218
|
+
Enabled: true
|
219
|
+
|
220
|
+
Style/HashAsLastArrayItem:
|
221
|
+
Enabled: true
|
222
|
+
|
223
|
+
Style/HashEachMethods:
|
224
|
+
Enabled: true
|
225
|
+
|
226
|
+
Style/HashLikeCase:
|
227
|
+
Enabled: true
|
228
|
+
|
229
|
+
Style/HashTransformKeys:
|
230
|
+
Enabled: true
|
231
|
+
|
232
|
+
Style/HashTransformValues:
|
233
|
+
Enabled: true
|
234
|
+
|
235
|
+
Style/RedundantAssignment:
|
236
|
+
Enabled: true
|
237
|
+
|
238
|
+
Style/RedundantFetchBlock:
|
239
|
+
Enabled: true
|
240
|
+
|
241
|
+
Style/RedundantFileExtensionInRequire:
|
242
|
+
Enabled: true
|
243
|
+
|
244
|
+
Style/RedundantRegexpCharacterClass:
|
245
|
+
Enabled: true
|
246
|
+
|
247
|
+
Style/RedundantRegexpEscape:
|
248
|
+
Enabled: true
|
249
|
+
|
250
|
+
Style/SlicingWithRange:
|
251
|
+
Enabled: true
|
252
|
+
|
188
253
|
AllCops:
|
189
|
-
TargetRubyVersion: "2.
|
254
|
+
TargetRubyVersion: "2.4.0"
|
190
255
|
Exclude:
|
191
256
|
- './tmp/**/*'
|
192
257
|
- './Gemfile'
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
acbaker (
|
4
|
+
acbaker (2.0.0)
|
5
5
|
commander (~> 4.4)
|
6
6
|
json (~> 2.2)
|
7
7
|
rmagick (~> 3.1, >= 3.1.0)
|
@@ -9,47 +9,52 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
ast (2.4.
|
13
|
-
coderay (1.1.
|
14
|
-
commander (4.
|
12
|
+
ast (2.4.1)
|
13
|
+
coderay (1.1.3)
|
14
|
+
commander (4.5.2)
|
15
15
|
highline (~> 2.0.0)
|
16
|
-
diff-lcs (1.
|
17
|
-
highline (2.0.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
method_source (~> 0.9.0)
|
16
|
+
diff-lcs (1.4.4)
|
17
|
+
highline (2.0.3)
|
18
|
+
json (2.3.1)
|
19
|
+
method_source (1.0.0)
|
20
|
+
minitest (5.14.1)
|
21
|
+
parallel (1.19.2)
|
22
|
+
parser (2.7.1.4)
|
23
|
+
ast (~> 2.4.1)
|
24
|
+
pry (0.13.1)
|
25
|
+
coderay (~> 1.1)
|
26
|
+
method_source (~> 1.0)
|
28
27
|
rainbow (3.0.0)
|
29
|
-
rake (12.3.
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
rspec-
|
35
|
-
|
36
|
-
rspec-
|
37
|
-
rspec-
|
28
|
+
rake (12.3.3)
|
29
|
+
regexp_parser (1.7.1)
|
30
|
+
rexml (3.2.4)
|
31
|
+
rmagick (3.2.0)
|
32
|
+
rspec (3.9.0)
|
33
|
+
rspec-core (~> 3.9.0)
|
34
|
+
rspec-expectations (~> 3.9.0)
|
35
|
+
rspec-mocks (~> 3.9.0)
|
36
|
+
rspec-core (3.9.2)
|
37
|
+
rspec-support (~> 3.9.3)
|
38
|
+
rspec-expectations (3.9.2)
|
38
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-mocks (3.
|
40
|
+
rspec-support (~> 3.9.0)
|
41
|
+
rspec-mocks (3.9.1)
|
41
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-support (3.
|
44
|
-
rubocop (0.
|
45
|
-
jaro_winkler (~> 1.5.1)
|
43
|
+
rspec-support (~> 3.9.0)
|
44
|
+
rspec-support (3.9.3)
|
45
|
+
rubocop (0.88.0)
|
46
46
|
parallel (~> 1.10)
|
47
|
-
parser (>= 2.
|
47
|
+
parser (>= 2.7.1.1)
|
48
48
|
rainbow (>= 2.2.2, < 4.0)
|
49
|
+
regexp_parser (>= 1.7)
|
50
|
+
rexml
|
51
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
49
52
|
ruby-progressbar (~> 1.7)
|
50
|
-
unicode-display_width (>= 1.4.0, <
|
51
|
-
|
52
|
-
|
53
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
54
|
+
rubocop-ast (0.2.0)
|
55
|
+
parser (>= 2.7.0.1)
|
56
|
+
ruby-progressbar (1.10.1)
|
57
|
+
unicode-display_width (1.7.0)
|
53
58
|
|
54
59
|
PLATFORMS
|
55
60
|
ruby
|
@@ -63,4 +68,4 @@ DEPENDENCIES
|
|
63
68
|
rubocop (~> 0.69)
|
64
69
|
|
65
70
|
BUNDLED WITH
|
66
|
-
1.
|
71
|
+
2.1.4
|
data/acbaker.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.homepage = "http://www.magloft.com"
|
13
13
|
s.summary = "Convert any source images into xcode asset catalogs."
|
14
14
|
s.description = "This gem allows easy conversion and management of xcode asset catalogs."
|
15
|
-
s.
|
15
|
+
s.required_ruby_version = '>= 2.4'
|
16
16
|
s.add_dependency "commander", "~> 4.4"
|
17
17
|
s.add_dependency "json", "~> 2.2"
|
18
18
|
s.add_dependency "rmagick", "~> 3.1", ">= 3.1.0"
|
data/lib/acbaker/asset_pack.rb
CHANGED
@@ -80,9 +80,10 @@ module Acbaker
|
|
80
80
|
|
81
81
|
# Add subtype
|
82
82
|
if image_spec['subtype']
|
83
|
-
|
83
|
+
case image_spec['subtype']
|
84
|
+
when '736h'
|
84
85
|
filename_array.push('retina-hd-55')
|
85
|
-
|
86
|
+
when '667h'
|
86
87
|
filename_array.push('retina-hd-47')
|
87
88
|
else
|
88
89
|
filename_array.push(image_spec['subtype'])
|
@@ -10,7 +10,7 @@ module Acbaker
|
|
10
10
|
def run(image, image_spec, width = nil, height = nil)
|
11
11
|
transform_width = width.to_f
|
12
12
|
transform_height = height.to_f
|
13
|
-
image_ratio = image.rows.to_f / image.columns
|
13
|
+
image_ratio = image.rows.to_f / image.columns
|
14
14
|
|
15
15
|
# calculate dimensions
|
16
16
|
if @options['max-width']
|
@@ -35,9 +35,7 @@ module Acbaker
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# place image
|
38
|
-
|
39
|
-
|
40
|
-
image
|
38
|
+
canvas.composite(image, Magick::CenterGravity, Magick::OverCompositeOp)
|
41
39
|
end
|
42
40
|
end
|
43
41
|
end
|
@@ -22,9 +22,7 @@ module Acbaker
|
|
22
22
|
# place image
|
23
23
|
gravity_string = "Magick::#{@options['gravity']}Gravity"
|
24
24
|
gravity = Object.const_get(gravity_string)
|
25
|
-
|
26
|
-
|
27
|
-
image
|
25
|
+
canvas.composite(image, gravity, Magick::OverCompositeOp)
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
@@ -22,9 +22,7 @@ module Acbaker
|
|
22
22
|
# place image
|
23
23
|
gravity_string = "Magick::#{@options['gravity']}Gravity"
|
24
24
|
gravity = Object.const_get(gravity_string)
|
25
|
-
|
26
|
-
|
27
|
-
image
|
25
|
+
canvas.composite(image, gravity, Magick::OverCompositeOp)
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
data/lib/acbaker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acbaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Strebitzer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -172,15 +172,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
172
|
requirements:
|
173
173
|
- - ">="
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version: '
|
175
|
+
version: '2.4'
|
176
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
180
|
+
version: '0'
|
181
181
|
requirements: []
|
182
|
-
|
183
|
-
rubygems_version: 2.5.2
|
182
|
+
rubygems_version: 3.1.2
|
184
183
|
signing_key:
|
185
184
|
specification_version: 4
|
186
185
|
summary: Convert any source images into xcode asset catalogs.
|