fastlane-plugin-branding 0.1.0 → 0.1.4

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
- SHA1:
3
- metadata.gz: aecdd5e0b923c88d8b5a1e26a3265350e943d10d
4
- data.tar.gz: bde93e07654606ca40aaad7e9ffdec80f16c615f
2
+ SHA256:
3
+ metadata.gz: 5fff389605deb85a3b0d307fa9528bc0a7aef85f5506468adecb690daac00744
4
+ data.tar.gz: d42df4bfd343a2e25f59dde5777b7d1a292552a408bacdee792e44ac26c8412f
5
5
  SHA512:
6
- metadata.gz: 2f462aefc94aca20d4c4d12b4d0b91d45f116221b783afc2dcebbb48d4c87a2f991464eafbcc464503e9894a1a8d0ae0ace24e51e903a197e35b422ee40bd979
7
- data.tar.gz: 79821159a4d0926ef3428407ea55fba60bfd1716c4f90d300a915c448a43eeda125ced585c82ae6cd51275dbcb48d82ff9ea16dbc4dc597e4cb1bb24af2c54b2
6
+ metadata.gz: 911802ede73dc17a2604271436796c5d3fd8199b79a11be86be9dbdd2633bf2119065e83683a3b20ab74f08546744705a109ca7a9fc714fb368aff0a78eced49
7
+ data.tar.gz: 741122b9a87d82f6412c4c78a3ddf39c1c01579e49a709c7ca94c8f92480b971cf1cd2bb6d6ede98c17a9106b23bec6ffec485b20dc4fb6dadfc6895b356be09
data/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # branding plugin
2
2
 
3
3
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-branding)
4
+ ![gem version](https://badge.fury.io/rb/fastlane-plugin-branding.svg)
5
+
6
+
7
+ Render your App's icon to the terminal whenever you run fastlane!
8
+
9
+ [![asciicast](https://asciinema.org/a/6xe3kkh6a6qm5v8awvp08fm3q.png)](https://asciinema.org/a/6xe3kkh6a6qm5v8awvp08fm3q)
10
+
11
+ _Serious Branding!_
4
12
 
5
13
  ## Getting Started
6
14
 
@@ -10,30 +18,31 @@ This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To ge
10
18
  fastlane add_plugin branding
11
19
  ```
12
20
 
13
- ## About branding
14
-
15
- Add some branding to your fastlane output
16
-
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
-
19
- ## Example
20
-
21
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
21
+ Once you've added the plugin, add the `branding` action to your `Fastfile`.
22
+ Like this:
23
+ ```ruby
24
+ platform :ios do
25
+ before_all do
26
+ branding
27
+ end
28
+ end
29
+ ```
30
+ or:
31
+ ```ruby
32
+ platform :android do
33
+ before_all do
34
+ branding(brand_icon_path: "./resources/**/icon.*")
35
+ end
36
+ end
37
+ ```
22
38
 
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
39
+ ## Why?
24
40
 
25
- ## Run tests for this plugin
41
+ You worked hard on your app, so show some pride and see your app's icon during the start of your fastlane runs.
26
42
 
27
- To run both the tests, and code style validation, run
43
+ ## Usage
28
44
 
29
- ````
30
- rake
31
- ```
32
-
33
- To automatically fix many of the styling issues, use
34
- ```
35
- rubocop -a
36
- ```
45
+ This plugin makes use of [branding.rb](https://github.com/snatchev/branding.rb) to render your AppIcon in glorious hi-res 240 colors!
37
46
 
38
47
  ## Issues and Feedback
39
48
 
@@ -4,12 +4,15 @@ module Fastlane
4
4
  module Actions
5
5
  class BrandingAction < Action
6
6
  def self.run(params)
7
- rows, cols = Branding::Canvas.terminal_size
8
- ideal_width = cols / 6
9
- path = best_icon(ideal_width)
10
- logo = Branding::Logo.new(path)
11
- logo.algo = :hires
12
- logo.print
7
+ rows, cols = ::Branding::Canvas.terminal_size
8
+ ideal_width = cols / 3
9
+
10
+ if path = best_icon(params[:brand_icon_path], ideal_width)
11
+ logo = ::Branding::Logo.new(path)
12
+ logo.algo = :normal
13
+ logo.print
14
+ puts "\e[0m"
15
+ end
13
16
  end
14
17
 
15
18
  def self.description
@@ -22,29 +25,39 @@ module Fastlane
22
25
 
23
26
  def self.available_options
24
27
  [
25
- # FastlaneCore::ConfigItem.new(key: :your_option,
26
- # env_name: "BRANDING_YOUR_OPTION",
27
- # description: "A description of your option",
28
- # optional: false,
29
- # type: String)
28
+ FastlaneCore::ConfigItem.new(key: :brand_icon_path,
29
+ env_name: "BRAND_ICON_PATH",
30
+ description: "specific path to icon",
31
+ optional: true,
32
+ type: String)
30
33
  ]
31
34
  end
32
35
 
33
36
  def self.is_supported?(platform)
34
37
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
35
38
  # See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
36
- [:ios, :mac].include?(platform)
39
+ [:ios, :mac, :android].include?(platform)
37
40
  end
38
41
 
39
- def self.best_icon(ideal_width)
40
- icon_paths = Dir.glob("**/AppIcon.iconset/*.png").map(&File.method(:realpath))
42
+ def self.best_icon(brand_icon_path, ideal_width)
43
+ icon_paths = Dir.glob(brand_icon_path || "**/AppIcon.appiconset/*.png").map(&File.method(:realpath))
44
+
45
+ paths = icon_paths.filter do |path|
46
+ begin
47
+ png = ::Branding::PNG.from_file(path)
48
+ true
49
+ rescue NotImplementedError => err
50
+ false
51
+ end
52
+ end
41
53
 
42
- paths = icon_paths.sort_by do |path|
43
- png = PNG.from_file(path)
54
+ paths = paths.sort_by do |path|
55
+ png = ::Branding::PNG.from_file(path)
44
56
  (ideal_width - png.width).abs
45
57
  end
46
58
 
47
59
  if paths.empty?
60
+ puts "No branding image found. Only true color is supported at the moment, so check the color depth of your images and try again."
48
61
  nil
49
62
  else
50
63
  paths.first
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Branding
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-branding
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-08 00:00:00.000000000 Z
11
+ date: 2021-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: branding
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.3
19
+ version: 0.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.3
26
+ version: 0.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fastlane
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ files:
50
50
  - lib/fastlane/plugin/branding/actions/branding_action.rb
51
51
  - lib/fastlane/plugin/branding/helper/branding_helper.rb
52
52
  - lib/fastlane/plugin/branding/version.rb
53
- homepage:
53
+ homepage: https://github.com/snatchev/fastlane-branding-plugin
54
54
  licenses:
55
55
  - MIT
56
56
  metadata: {}
@@ -69,10 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubyforge_project:
73
- rubygems_version: 2.4.5.1
72
+ rubygems_version: 3.0.3.1
74
73
  signing_key:
75
74
  specification_version: 4
76
75
  summary: Add some branding to your fastlane output
77
76
  test_files: []
78
- has_rdoc: