Class: Fastlane::Actions::SnapshotAction

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

Class Method Summary collapse

Methods inherited from Fastlane::Action

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

Class Method Details

.authorObject



37
38
39
# File 'lib/fastlane/actions/snapshot.rb', line 37

def self.author
  "KrauseFx"
end

.available_optionsObject



31
32
33
34
35
# File 'lib/fastlane/actions/snapshot.rb', line 31

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

.descriptionObject



27
28
29
# File 'lib/fastlane/actions/snapshot.rb', line 27

def self.description
  "Generate new localised screenshots on multiple devices"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/fastlane/actions/snapshot.rb', line 41

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

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fastlane/actions/snapshot.rb', line 8

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

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

    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
  ensure
    FastlaneCore::UpdateChecker.show_update_status('snapshot', Snapshot::VERSION)
  end
end