Sha256: 5c0bd5f23a4ec77270dd2987f4586e44fe24a12e18f0eac2ce7b0187e9cb41ea

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

module Snapshot
  class DetectValues
    # This is needed as these are more complex default values
    def self.set_additional_default_values
      config = Snapshot.config

      FastlaneCore::Project.detect_projects(config)

      Snapshot.project = FastlaneCore::Project.new(config)

      # Go into the project's folder
      Dir.chdir(File.expand_path("..", Snapshot.project.path)) do
        config.load_configuration_file(Snapshot.snapfile_name)
      end

      Snapshot.project.select_scheme

      # Devices
      unless config[:devices]
        config[:devices] = []

        # We only care about a subset of the simulators
        FastlaneCore::Simulator.all.each do |sim|
          next if sim.name.include?("iPad") and !sim.name.include?("Retina") # we only need one iPad
          next if sim.name.include?("6s") # same screen resolution
          next if sim.name.include?("5s") # same screen resolution
          next if sim.name.include?("Apple TV")

          config[:devices] << sim.name
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
snapshot-1.1.0 lib/snapshot/detect_values.rb
snapshot-1.0.5 lib/snapshot/detect_values.rb
snapshot-1.0.4 lib/snapshot/detect_values.rb
snapshot-1.0.3 lib/snapshot/detect_values.rb