Class: Fastlane::Actions::FrameScreenshotsAction

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

Direct Known Subclasses

FrameitAction

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



40
41
42
# File 'fastlane/lib/fastlane/actions/frame_screenshots.rb', line 40

def self.author
  "KrauseFx"
end

.available_optionsObject



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

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] || FastlaneCore::FastlaneFolder.path,
                                 default_value_dynamic: true)
  ]
end

.categoryObject



54
55
56
# File 'fastlane/lib/fastlane/actions/frame_screenshots.rb', line 54

def self.category
  :screenshots
end

.descriptionObject



17
18
19
# File 'fastlane/lib/fastlane/actions/frame_screenshots.rb', line 17

def self.description
  "Adds device frames around all screenshots (via _frameit_)"
end

.detailsObject



21
22
23
24
25
26
# File 'fastlane/lib/fastlane/actions/frame_screenshots.rb', line 21

def self.details
  [
    "Uses [frameit](https://docs.fastlane.tools/actions/frameit/) to prepare perfect screenshots for the App Store, your website, QA or emails.",
    "You can add background and titles to the framed screenshots as well."
  ].join("\n")
end

.example_codeObject



44
45
46
47
48
49
50
51
52
# File 'fastlane/lib/fastlane/actions/frame_screenshots.rb', line 44

def self.example_code
  [
    'frame_screenshots',
    'frameit # alias for "frame_screenshots"',
    'frame_screenshots(silver: true)',
    'frame_screenshots(path: "/screenshots")',
    'frame_screenshots(rose_gold: true)'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



58
59
60
# File 'fastlane/lib/fastlane/actions/frame_screenshots.rb', line 58

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
# File 'fastlane/lib/fastlane/actions/frame_screenshots.rb', line 4

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

  require 'frameit'

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

  Dir.chdir(config[:path]) do
    Frameit.config = config
    Frameit::Runner.new.run('.')
  end
end