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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c4b531a62b518edcbfb5ef5d6696cd3a109511b
4
- data.tar.gz: b85e2d2e122b8f4c32497f4b5274729793b44a64
3
+ metadata.gz: 793589ac361a9c33cdce43eb8d36bf667a13e917
4
+ data.tar.gz: e4c24b4157cc2728607dda48bb9f20a7e461bcf1
5
5
  SHA512:
6
- metadata.gz: 75f7533dbabe59ff64b89e884440da4bbe438101dd851f600a79ad2434ccc2e5a63ead9709df95a7c45622a1b7941ba864470198df7054ecdece69d6eb9422dd
7
- data.tar.gz: 8af5b26a8ffd8881c3b945173ce4b1bad502f5bf24b7007abaff2cfb96cbf6818877f33354eb520f7279312c1979d61336c5ba1e3f36ea5ba29e2165743ec7db
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 the part of the screenshot filename. The *value* is a map with 2 optional keys, *text* and *background*.
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.message "Using template: #{template.name} (#{template.width}x#{template.height})"
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.message "Using text: #{text}"
58
+ UI.verbose "Using text: #{text}"
58
59
 
59
60
  colors = self.find_colors(source_folder, file)
60
- UI.message "Using colors: #{colors}"
61
+ UI.verbose "Using colors: #{colors}"
61
62
 
62
63
  output = self.find_output(source_folder, file, output_folder, params[:output_suffix])
63
- UI.message "Saving to: #{output}"
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
- # Read device name from file
133
- filename = File.basename(screenshot_file)
134
- device = filename.slice(0, filename.rindex('-'))
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 }
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Framer
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
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.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-08 00:00:00.000000000 Z
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: