Class: Fastlane::Actions::SnapshotAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, lane_context, method_missing, other_action, output, return_value, sample_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

.categoryObject



55
56
57
# File 'lib/fastlane/actions/snapshot.rb', line 55

def self.category
  :screenshots
end

.descriptionObject



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

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

.example_codeObject



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

def self.example_code
  [
    'snapshot',
    'snapshot(
      skip_open_summary: true,
      clean: true
    )'
  ]
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