Class: Fastlane::Actions::EmojiFetcherAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/emoji_fetcher/actions/emoji_fetcher_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



17
18
19
# File 'lib/fastlane/plugin/emoji_fetcher/actions/emoji_fetcher_action.rb', line 17

def self.authors
  ["Felix Krause"]
end

.available_optionsObject



21
22
23
24
25
26
27
28
29
# File 'lib/fastlane/plugin/emoji_fetcher/actions/emoji_fetcher_action.rb', line 21

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                            env_name: "EMOJI_FETCHER_PATH",
                         description: "Path to which the emoji file should be copied to",
                            optional: false,
                                type: String)
  ]
end

.descriptionObject



13
14
15
# File 'lib/fastlane/plugin/emoji_fetcher/actions/emoji_fetcher_action.rb', line 13

def self.description
  "Fetch the emoji font file and copy it into a local directory"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/fastlane/plugin/emoji_fetcher/actions/emoji_fetcher_action.rb', line 31

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fastlane/plugin/emoji_fetcher/actions/emoji_fetcher_action.rb', line 4

def self.run(params)
  require 'fileutils'

  original = "/System/Library/Fonts/Apple Color Emoji.ttf"
  UI.user_eror!("Could not find font file at path '#{original}'") unless File.exist?(original)
  FileUtils.cp(original, params[:path])
  UI.success("Successfully fetched Emoji font")
end