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, available_options, details, output, sh

Class Method Details

.authorObject



29
30
31
# File 'lib/fastlane/actions/frameit.rb', line 29

def self.author
  "KrauseFx"
end

.descriptionObject



25
26
27
# File 'lib/fastlane/actions/frameit.rb', line 25

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/fastlane/actions/frameit.rb', line 33

def self.is_supported?(platform)
  platform == :ios
end

.run(params) ⇒ Object



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

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

  require 'frameit'

  begin
    FastlaneCore::UpdateChecker.start_looking_for_update('frameit') unless Helper.is_test?
    color = Frameit::Editor::Color::BLACK
    color = Frameit::Editor::Color::SILVER if [:silver, :white].include?(params)

    screenshots_folder = Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
    screenshots_folder ||= FastlaneFolder.path

    Dir.chdir(screenshots_folder) do
      Frameit::Editor.new.run('.', color)
    end
  ensure
    FastlaneCore::UpdateChecker.show_update_status('frameit', Frameit::VERSION)
  end
end