Class: Fastlane::Actions::CaptureIosScreenshotsAction

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

Direct Known Subclasses

CaptureScreenshotsAction, SnapshotAction

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, details, 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



31
32
33
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 31

def self.author
  "KrauseFx"
end

.available_optionsObject



25
26
27
28
29
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 25

def self.available_options
  return [] unless Helper.mac?
  require 'snapshot'
  Snapshot::Options.available_options
end

.categoryObject



50
51
52
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 50

def self.category
  :screenshots
end

.descriptionObject



21
22
23
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 21

def self.description
  "Generate new localized screenshots on multiple devices (via _snapshot_)"
end

.example_codeObject



39
40
41
42
43
44
45
46
47
48
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 39

def self.example_code
  [
    'capture_ios_screenshots',
    'snapshot # alias for "capture_ios_screenshots"',
    'capture_ios_screenshots(
      skip_open_summary: true,
      clean: true
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



35
36
37
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 35

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

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 8

def self.run(params)
  return nil unless Helper.mac?
  require 'snapshot'

  Snapshot.config = params
  Snapshot::DependencyChecker.check_simulators
  Snapshot::Runner.new.work

  Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = File.expand_path(params[:output_directory]) # absolute URL

  true
end