b0VIM 8.2DÁÓ`3É,ÕfjoshholtzJoshs-MacBook-Air.local~joshholtz/Developer/fastlane/fastlane/frameit/lib/frameit/device.rb 3210#"! UtpZadËOZìÒѳ—–‚_?"æ̧¦þ š ‹ ^ 7  û Ú µ š i a ` O  ë à Î Ä ¼ » • \ T S . ü ô ó È ¦ ¥ > = $  Ö ² Œ V Å…g]\D¯…„Mñéèrÿ‡\@'©…_±‘…{aYSONend end end return found_device end end found_device = device if (device.id == id || device.deliver_screen_id == id || device.formatted_name_without_apple == id) && (found_device.nil? || device.priority > found_device.priority) device = Devices.const_get(c) Devices.constants.each do |c| # multiple devices can be matched to the same deliver_screen_id constant -> we return the one with the highest priority found_device = nil return nil if id.nil? def self.find_device_by_id_or_name(id) # Therefore this function matches both ScreenSize constants and formatted names to maintain backward compatibility. # options.rb defined a few Apple devices with unspecified IDs, this option was never read from Frameit.config. # Previously ENV[FRAMEIT_FORCE_DEVICE_TYPE] was matched to Deliver::AppScreenshot::ScreenSize constants. However, end return nil UI.user_error!("Unsupported screen size #{size} for path '#{path}'") # no device detected - show error and return nil return found_device if found_device # return found_device which was detected according to platform & priority & settings if found return filename_device if filename_device # prefer filename end found_device = device next unless device.is_chosen_platform?(platform) && (found_device.nil? || device.priority > found_device.priority) filename_device = device if (filename.include?(device.formatted_name_without_apple) || filename.include?(device.id)) && (filename_device.nil? || filename_device.priority < device.priority) # assign to filename_device if the filename contains the formatted name / id and its priority is higher than the current filename_device next unless device.resolutions.include?(size) device = Devices.const_get(c) Devices.constants.each do |c| filename = Pathname.new(path).basename.to_s filename_device = nil found_device = nil UI.user_error!("Could not find or parse file at path '#{path}'") if size.nil? || size.count == 0 size = FastImage.size(path) def self.detect_device(path, platform) end formatted_name.gsub("Apple", "").strip.to_s def formatted_name_without_apple end @platform == platform || platform == Platform::ANY def is_chosen_platform?(platform) end end @priority else REQUIRED_PRIORITY if !priority_config_key.nil? && Frameit.config[priority_config_key] def priority end @priority_config_key = priority_config_key @platform = platform @default_color = default_color @density_ppi = density_ppi @resolutions = resolutions @priority = priority @formatted_name = formatted_name @deliver_screen_id = deliver_screen_id @id = id Raise("Priority mustn't be higher than #{REQUIRED_PRIORITY}") if priority > REQUIRED_PRIORITY def initialize(id, formatted_name, priority, resolutions, density_ppi, default_color, platform = Platform::IOS, deliver_screen_id = nil, priority_config_key = nil) attr_reader :priority_config_key attr_reader :platform attr_reader :default_color attr_reader :density_ppi attr_reader :resolutions attr_reader :formatted_name attr_reader :deliver_screen_id attr_reader :id REQUIRED_PRIORITY = 999 class Devicemodule Frameitrequire_relative 'module'require 'fastimage'