fastlane-plugin-framer 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fastlane/plugin/framer/actions/framer_action.rb +18 -9
- data/lib/fastlane/plugin/framer/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 793589ac361a9c33cdce43eb8d36bf667a13e917
|
4
|
+
data.tar.gz: e4c24b4157cc2728607dda48bb9f20a7e461bcf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 026f0a85c20cd76d7f5723aaafbb28b808edee7b40a6e1da32ed5d4cfba847337369f7abe1f324c83b5a193fe0aa318308e811fe9e8ebf3c70115522477f6bce
|
7
|
+
data.tar.gz: e3ecd5c1ff8141026593015f6c94052bb841451d5c161f4619a37f53c230fb96e36501ae672df376f46831751d413c8ebff4497c2e401d5d4300f675195f1b68
|
data/README.md
CHANGED
@@ -105,7 +105,7 @@ The *value* can be any strings.
|
|
105
105
|
|
106
106
|
You can customize the color of the text and the background color applyed below the template (if you have transparencies on the template, you can fill them with the background color).
|
107
107
|
|
108
|
-
`colors.json` is a simple map where *key* is
|
108
|
+
`colors.json` is a simple map where *key* is part of the screenshot filename. The *value* is a map with 2 optional keys, *text* and *background*.
|
109
109
|
|
110
110
|
```
|
111
111
|
{
|
@@ -36,6 +36,7 @@ module Fastlane
|
|
36
36
|
output_folder = params[:output_folder]
|
37
37
|
template_folder = params[:template_folder]
|
38
38
|
templates = []
|
39
|
+
platform = Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]
|
39
40
|
|
40
41
|
# Read config
|
41
42
|
UI.success "Fetching templates from #{template_folder}"
|
@@ -46,21 +47,21 @@ module Fastlane
|
|
46
47
|
Dir.glob("#{source_folder}/**/*.png") do |file|
|
47
48
|
UI.message "Processing #{file}"
|
48
49
|
|
49
|
-
template = self.find_template(templates, file)
|
50
|
+
template = self.find_template(templates, file, platform)
|
50
51
|
if template.nil?
|
51
52
|
UI.error "Unable to find template for screenshot #{file}"
|
52
53
|
next
|
53
54
|
end
|
54
|
-
UI.
|
55
|
+
UI.verbose "Using template: #{template.name} (#{template.width}x#{template.height})"
|
55
56
|
|
56
57
|
text = self.find_text(source_folder, file)
|
57
|
-
UI.
|
58
|
+
UI.verbose "Using text: #{text}"
|
58
59
|
|
59
60
|
colors = self.find_colors(source_folder, file)
|
60
|
-
UI.
|
61
|
+
UI.verbose "Using colors: #{colors}"
|
61
62
|
|
62
63
|
output = self.find_output(source_folder, file, output_folder, params[:output_suffix])
|
63
|
-
UI.
|
64
|
+
UI.verbose "Saving to: #{output}"
|
64
65
|
|
65
66
|
# Do the magic
|
66
67
|
self.combine(file, template, colors, text, output)
|
@@ -128,10 +129,18 @@ module Fastlane
|
|
128
129
|
return templates
|
129
130
|
end
|
130
131
|
|
131
|
-
def self.find_template(templates, screenshot_file)
|
132
|
-
|
133
|
-
|
134
|
-
|
132
|
+
def self.find_template(templates, screenshot_file, platform)
|
133
|
+
if [:ios, :mac].include? platform
|
134
|
+
# Read device name from file
|
135
|
+
filename = File.basename(screenshot_file)
|
136
|
+
device = filename.slice(0, filename.rindex('-'))
|
137
|
+
elsif :android == platform
|
138
|
+
# Read device name from path
|
139
|
+
folder = File.basename(File.dirname(screenshot_file))
|
140
|
+
device = folder.slice(0, folder.rindex('S'))
|
141
|
+
else
|
142
|
+
UI.error "Unsupported platform"
|
143
|
+
end
|
135
144
|
|
136
145
|
# Search template that matches that size
|
137
146
|
return templates.find { |template| template.name == device }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-framer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DrAL3X
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|
@@ -161,3 +161,4 @@ specification_version: 4
|
|
161
161
|
summary: Create images combining app screenshots with templates to make nice pictures
|
162
162
|
for the App Store
|
163
163
|
test_files: []
|
164
|
+
has_rdoc:
|