Class: Fastlane::Actions::FrameitAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/frameit.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, method_missing, other_action, output, return_value, sh, step_text

Class Method Details

.authorObject



38
39
40
# File 'lib/fastlane/actions/frameit.rb', line 38

def self.author
  "KrauseFx"
end

.available_optionsObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/fastlane/actions/frameit.rb', line 27

def self.available_options
  require "frameit"
  require "frameit/options"
  FastlaneCore::CommanderGenerator.new.generate(Frameit::Options.available_options) + [
    FastlaneCore::ConfigItem.new(key: :path,
                                 env_name: "FRAMEIT_SCREENSHOTS_PATH",
                                 description: "The path to the directory containing the screenshots",
                                  default_value: Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] || FastlaneFolder.path)
  ]
end

.descriptionObject



23
24
25
# File 'lib/fastlane/actions/frameit.rb', line 23

def self.description
  "Adds device frames around the screenshots using frameit"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/fastlane/actions/frameit.rb', line 42

def self.is_supported?(platform)
  [:ios, :mac].include? platform
end

.run(config) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/actions/frameit.rb', line 4

def self.run(config)
  return if Helper.test?

  require 'frameit'

  begin
    FastlaneCore::UpdateChecker.start_looking_for_update('frameit') unless Helper.is_test?

    UI.message("Framing screenshots at path #{config[:path]}")

    Dir.chdir(config[:path]) do
      Frameit.config = config
      Frameit::Runner.new.run('.')
    end
  ensure
    FastlaneCore::UpdateChecker.show_update_status('frameit', Frameit::VERSION)
  end
end