Class: Badge::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/badge/options.rb

Constant Summary collapse

AVAILABLE_GRAVITIES =
%w(NorthWest North NorthEast West Center East SouthWest South SouthEast)

Class Method Summary collapse

Class Method Details

.available_optionsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/badge/options.rb', line 6

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :dark,
                                 description: "Adds a dark badge instead of the white",
                                 is_string: false,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :alpha,
                                 description: "Uses the work alpha instead of beta",
                                 is_string: false,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :alpha_channel,
                                 description: "Keeps/Adds an alpha channel to the icons",
                                 is_string: false,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :custom,
                                 description: "Overlay a custom image on your icon",
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :no_badge,
                                 description: "Removes the beta badge",
                                 is_string: false,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :badge_gravity,
                                 description: "Position of the badge on icon. Default: SouthEast - Choices include: #{AVAILABLE_GRAVITIES.join(', ')}",
                                 verify_block: proc do |value|
                                   UI.user_error!("badge_gravity #{value} is invalid") unless AVAILABLE_GRAVITIES.map(&:upcase).include? value.upcase
                                 end,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :shield,
                                 description: "Overlay a shield from shields.io on your icon, eg: Version-1.2-green",
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :shield_parameters,
                                 description: "Parameters of the shield image. String of key-value pairs separated by ampersand as specified on shields.io, eg: colorA=abcdef&style=flat",
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :shield_io_timeout,
                                 description: "The timeout in seconds we should wait the get a response from shields.io",
                                 type: Integer,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :shield_geometry,
                                 description: "Position of shield on icon, relative to gravity e.g, +50+10%",
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :shield_gravity,
                                 description: "Position of shield on icon. Default: North - Choices include: #{AVAILABLE_GRAVITIES.join(', ')}",
                                 verify_block: proc do |value|
                                   UI.user_error!("badge_gravity #{value} is invalid") unless AVAILABLE_GRAVITIES.map(&:upcase).include? value.upcase
                                 end,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :shield_scale,
                                 description: "Shield image scale factor; e.g, 0.5, 2, etc. - works with --shield_no_resize",
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :shield_no_resize,
                                 description: "Shield image will no longer be resized to aspect fill the full icon. Instead it will only be shrinked to not exceed the icon graphic",
                                 is_string: false,
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :glob,
                                 description: "Glob pattern for finding image files Default: CURRENT_PATH/**/*.appiconset/*.{png,PNG}",
                                 optional: true),

    FastlaneCore::ConfigItem.new(key: :grayscale,
                                 description: "Whether making icons to grayscale",
                                 is_string: false,
                                 default_value: false,
                                 optional: true)
  ]
end